aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-04-24 22:34:26 +0200
committerAnders Broman <a.broman58@gmail.com>2018-04-25 06:57:00 +0000
commit614495138077a02a1fa09f6c59a0e6f1d783a1e4 (patch)
tree83a4e289734d639109cec2e4ef7d1b49a4545e23 /tshark.c
parent0de109ef57ebd6ddf25c87c599c9d8b522967a3b (diff)
dfilter: fix memleaks with functions and slice operator
Running tools/dfilter-test.py with LSan enabled resulted in 38 test failures due to memory leaks from "fvalue_new". Problematic dfilters: - Return values from functions, e.g. `len(data.data) > 8` (instruction CALL_FUNCTION invoking functions from epan/dfilter/dfunctions.c) - Slice operator: `data.data[1:2] == aa:bb` (function mk_range) These values end up in "registers", but as some values (from READ_TREE) reference the proto tree, a new tracking flag ("owns_memory") is added. Add missing tests for some functions and try to improve documentation. Change-Id: I28e8cf872675d0a81ea7aa5fac7398257de3f47b Reviewed-on: https://code.wireshark.org/review/27132 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index 504aae4226..fec5266d63 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2249,6 +2249,7 @@ clean_exit:
wtap_cleanup();
free_progdirs();
cf_close(&cfile);
+ dfilter_free(dfcode);
return exit_status;
}