diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-12-11 12:48:24 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-12-11 02:55:32 +0000 |
commit | 6e5aefc2d3095f0fb6535e6ab3a4ec12b898794f (patch) | |
tree | 6771a1fa80b8f5b1411fbcc27d3871fa319d25b0 /lib | |
parent | 0be0c044b6769da39b0feb8d7b655a2760413086 (diff) | |
download | samba-6e5aefc2d3095f0fb6535e6ab3a4ec12b898794f.tar.gz |
lib/fuzzing: Ensure mem_ctx is freed each time fuzz_ldb_parse_tree is run
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fuzzing/fuzz_ldb_parse_tree.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/fuzzing/fuzz_ldb_parse_tree.c b/lib/fuzzing/fuzz_ldb_parse_tree.c index bbcdeab2e67..01dbc124e2f 100644 --- a/lib/fuzzing/fuzz_ldb_parse_tree.c +++ b/lib/fuzzing/fuzz_ldb_parse_tree.c @@ -33,19 +33,20 @@ int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len) char *filter; if (len < 1) { - return 0; + goto out; } filter = talloc_strndup(mem_ctx, (const char*)buf, len); if (filter == NULL) { - return 0; + goto out; } tree = ldb_parse_tree(mem_ctx, filter); (void)ldb_filter_from_tree(tree, mem_ctx); +out: talloc_free(mem_ctx); return 0; |