set: free user data
PATCH 1/1 set: free user data
This was causing a memory leak when using set.
Catched by an ASAN run:
==21004==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 12 byte(s) in 2 object(s) allocated from:
#0 0x4cde58 in malloc (/usr/local/sbin/nft+0x4cde58)
#1 0x7ffff79b8c19 in nftnl_set_set_data /home/eric/git/netfilter/libnftnl/src/set.c:179Signed-off-by Eric Leblond <[email protected]>
--- src/set.c | 2 ++ 1 file changed, 2 insertions(+)
src/set.c +2 -0
@@ -48,6 +48,8 @@ void nftnl_set_free(const struct nftnl_set *s)xfree (s->table);if (s->flags & (1 <<NFTNL_SET_NAME ))xfree (s->name); +if (s->flags & (1 <<NFTNL_SET_USERDATA )) +xfree (s->user.data);list_for_each_entry_safe (elem, tmp, &s->element_list, head) {list_del (&elem->head);
Signature · 1 line
2.13.1
Quoted 11 lines · Eric Leblond
This was causing a memory leak when using set.
Catched by an ASAN run:
==21004==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 12 byte(s) in 2 object(s) allocated from:
#0 0x4cde58 in malloc (/usr/local/sbin/nft+0x4cde58) #1 0x7ffff79b8c19 in nftnl_set_set_data /home/eric/git/netfilter/libnftnl/src/set.c:179Signed-off-by Eric Leblond <[email protected]>
Please go push this, thanks!