[PATCH libnftnl] expr: dynset: release stateful expression from .free path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



==22778==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f3212406518 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7f321041703e in nftnl_expr_alloc /home/pablo/devel/scm/git-netfilter/libnftnl/src/expr.c:37
    #2 0x7f3211d51c16 in netlink_gen_limit_stmt /home/pablo/devel/scm/git-netfilter/nftables/src/netlink_linearize.c:859
    #3 0x7f3211d5220c in netlink_gen_stmt_stateful /home/pablo/devel/scm/git-netfilter/nftables/src/netlink_linearize.c:891
    #4 0x7f3211d58630 in netlink_gen_meter_stmt /home/pablo/devel/scm/git-netfilter/nftables/src/netlink_linearize.c:1441
[...]

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/expr/dynset.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/expr/dynset.c b/src/expr/dynset.c
index b2d8edca20ac..8b63cb0e5f92 100644
--- a/src/expr/dynset.c
+++ b/src/expr/dynset.c
@@ -277,6 +277,7 @@ static void nftnl_expr_dynset_free(const struct nftnl_expr *e)
 	struct nftnl_expr_dynset *dynset = nftnl_expr_data(e);
 
 	xfree(dynset->set_name);
+	nftnl_expr_free(dynset->expr);
 }
 
 struct expr_ops expr_ops_dynset = {
-- 
2.20.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux