diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-05-09 22:28:57 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-05-14 13:42:10 +0000 |
commit | bb81e1807b2a5b67905cfa1594dbbb535fe8b37e (patch) | |
tree | e4f934c0210d35b7563f790bd7a7e08fa5de377c /epan/dfilter | |
parent | d80acae40d14efeb857258ca923637b590dd6be9 (diff) |
Free g_ptr_array_free-related memory leaks
g_ptr_array_free(a, FALSE) returns "a->pdata". Callers that do not
handle this will leak memory (e.g. "tshark -G plugins"). Convert other
users to use the return value instead of direct access to "a->pdata".
Change-Id: I29835477d587f5f54bf0d94cdae9f375e3da3ce3
Reviewed-on: https://code.wireshark.org/review/27437
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/dfilter')
-rw-r--r-- | epan/dfilter/dfilter-macro.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c index 2ad7f5d366..f94970a895 100644 --- a/epan/dfilter/dfilter-macro.c +++ b/epan/dfilter/dfilter-macro.c @@ -409,12 +409,11 @@ done: g_ptr_array_add(parts,NULL); g_free(m->parts); - m->parts = (gchar**)parts->pdata; + m->parts = (gchar **)g_ptr_array_free(parts, FALSE); g_free(m->args_pos); m->args_pos = (int*)(void *)args_pos->data; - g_ptr_array_free(parts,FALSE); g_array_free(args_pos,FALSE); m->argc = argc; |