summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorEric Leblond <eric@regit.org>2017-07-11 00:32:50 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-07-17 17:20:33 +0200
commita82f609ea2d8ab05e00b45e28db207fc8bfd0e32 (patch)
treefcab5fb8ca52641433154058ffab92e34335efd5 /src/parser_bison.y
parentdb4ca92225cca8571af82c6b515f8d7b0d9fd591 (diff)
parser: fix memory leak in set creation
sudo ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.9/bin/llvm-symbolizer nft add set inet filter blacklisddddddddddddddddddddt {type inet_service \;} ================================================================= ==25152==ERROR: LeakSanitizer: detected memory leaks Direct leak of 13 byte(s) in 1 object(s) allocated from: #0 0x45cca0 in __interceptor_strdup (/usr/local/sbin/nft+0x45cca0) #1 0x593cb1 in xstrdup /home/eric/git/netfilter/nftables/src/utils.c:75:8 #2 0x5bccb2 in nft_lex /home/eric/git/netfilter/nftables/src/scanner.l:566:22 #3 0x5cb363 in nft_parse /home/eric/git/netfilter/nftables/src/parser_bison.c:4366:16 #4 0x505a37 in nft_run /home/eric/git/netfilter/nftables/src/main.c:246:8 #5 0x50771f in main /home/eric/git/netfilter/nftables/src/main.c:392:6 #6 0x7ff7befdb2b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) SUMMARY: AddressSanitizer: 13 byte(s) leaked in 1 allocation(s). Signed-off-by: Eric Leblond <eric@regit.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 87d898b8..45f134a8 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1456,8 +1456,10 @@ type_identifier_list : type_identifier
if (dtype == NULL) {
erec_queue(error(&@1, "unknown datatype %s", $1),
state->msgs);
+ xfree($1);
YYERROR;
}
+ xfree($1);
$$ = dtype->type;
}
| type_identifier_list DOT type_identifier