Fix Coverity Scan ID
1529284 by freeing the xtables_match from
xtables_find_match if found.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
static bool
need_protomatch(struct fw3_ipt_rule *r, const char *pname)
{
+ struct xtables_match *match;
+
if (!pname)
return false;
- if (!xtables_find_match(pname, XTF_DONT_LOAD, NULL))
+ match = xtables_find_match(pname, XTF_DONT_LOAD, NULL);
+ if (!match)
return true;
+ free(match);
return !r->protocol_loaded;
}