]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: ct_timeout: release policy string and state list
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 5 May 2020 19:02:16 +0000 (21:02 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 5 May 2020 19:02:50 +0000 (21:02 +0200)
=================================================================
==19037==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 18 byte(s) in 2 object(s) allocated from:
    #0 0x7ff6ee6f9810 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    #1 0x7ff6ee22666d in xstrdup /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:75
    #2 0x7ff6ee28cce9 in nft_parse /home/pablo/devel/scm/git-netfilter/nftables/src/parser_bison.c:5792
    #3 0x4b903f302c8010a  (<unknown module>)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7ff6ee7a8330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x7ff6ee226578 in xmalloc /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:36

SUMMARY: AddressSanitizer: 34 byte(s) leaked in 3 allocation(s).

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
src/parser_bison.y

index 4cf28987049b403a6607c1f353ebbd74ae52c5e1..9aa283fd2e12b28c7575deb0e1dc3263f9fe1082 100644 (file)
@@ -3902,6 +3902,7 @@ static int ct_timeout_evaluate(struct eval_ctx *ctx, struct obj *obj)
 
                ct->timeout[ts->timeout_index] = ts->timeout_value;
                list_del(&ts->head);
+               xfree(ts->timeout_str);
                xfree(ts);
        }
 
index 4369ece60ed0c38cc01b3a3c1c780d432034eb61..39d3eac83b163fedd9e294c873f4b48486f206a0 100644 (file)
@@ -3954,6 +3954,7 @@ ct_timeout_config :       PROTOCOL        ct_l4protoname  stmt_separator
 
                                ct = &$<obj>0->ct_timeout;
                                list_splice_tail($4, &ct->timeout_list);
+                               xfree($4);
                        }
                        |       L3PROTOCOL      family_spec_explicit    stmt_separator
                        {