nftnlrdr_misc.c: fix a memory leak in table_cb()
This commit is contained in:
parent
5f66d1852d
commit
92ec4d05ab
|
@ -497,7 +497,6 @@ table_cb(const struct nlmsghdr *nlh, void *data)
|
|||
{
|
||||
int result = MNL_CB_OK;
|
||||
struct nftnl_rule *rule;
|
||||
struct nftnl_expr *expr;
|
||||
struct nftnl_expr_iter *itr;
|
||||
UNUSED(data);
|
||||
|
||||
|
@ -556,10 +555,17 @@ table_cb(const struct nlmsghdr *nlh, void *data)
|
|||
}
|
||||
|
||||
itr = nftnl_expr_iter_create(rule);
|
||||
if (itr == NULL) {
|
||||
syslog(LOG_ERR, "%s: nftnl_expr_iter_create() FAILED",
|
||||
"table_cb");
|
||||
} else {
|
||||
struct nftnl_expr *expr;
|
||||
|
||||
while ((expr = nftnl_expr_iter_next(itr)) != NULL) {
|
||||
rule_expr_cb(expr, r);
|
||||
}
|
||||
nftnl_expr_iter_destroy(itr);
|
||||
}
|
||||
|
||||
switch (r->type) {
|
||||
case RULE_NAT:
|
||||
|
|
Loading…
Reference in New Issue