aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/epan
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-05-09 22:28:57 +0200
committerPeter Wu <peter@lekensteyn.nl>2018-05-14 13:42:10 +0000
commitbb81e1807b2a5b67905cfa1594dbbb535fe8b37e (patch)
treee4f934c0210d35b7563f790bd7a7e08fa5de377c /plugins/epan
parentd80acae40d14efeb857258ca923637b590dd6be9 (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 'plugins/epan')
-rw-r--r--plugins/epan/mate/mate_grammar.lemon2
-rw-r--r--plugins/epan/mate/mate_parser.l2
-rw-r--r--plugins/epan/mate/mate_runtime.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/plugins/epan/mate/mate_grammar.lemon b/plugins/epan/mate/mate_grammar.lemon
index c041d93ffb..ba020c13d6 100644
--- a/plugins/epan/mate/mate_grammar.lemon
+++ b/plugins/epan/mate/mate_grammar.lemon
@@ -436,7 +436,7 @@ pdu_decl ::=
g_ptr_array_add(transport_stack,g_ptr_array_remove_index(Stack,i));
}
- g_ptr_array_free(Stack,FALSE);
+ g_ptr_array_free(Stack, TRUE);
cfg->transport_ranges = transport_stack;
cfg->payload_ranges = Payload;
diff --git a/plugins/epan/mate/mate_parser.l b/plugins/epan/mate/mate_parser.l
index 2b61c9d069..0c140f2cb8 100644
--- a/plugins/epan/mate/mate_parser.l
+++ b/plugins/epan/mate/mate_parser.l
@@ -403,7 +403,7 @@ extern gboolean mate_load_config(const gchar* filename, mate_config* mc) {
fclose(in);
g_ptr_array_foreach(mc->config_stack, ptr_array_free, NULL);
- g_ptr_array_free(mc->config_stack, FALSE);
+ g_ptr_array_free(mc->config_stack, TRUE);
return status;
}
diff --git a/plugins/epan/mate/mate_runtime.c b/plugins/epan/mate/mate_runtime.c
index 293f4ce6f7..2bb31eb941 100644
--- a/plugins/epan/mate/mate_runtime.c
+++ b/plugins/epan/mate/mate_runtime.c
@@ -78,7 +78,7 @@ static gboolean destroy_mate_gogs(gpointer k _U_, gpointer v, gpointer p _U_) {
if (gog->gog_keys) {
gog_remove_keys(gog);
- g_ptr_array_free(gog->gog_keys,FALSE);
+ g_ptr_array_free(gog->gog_keys, TRUE);
}
g_slice_free(mate_max_size,(mate_max_size*)gog);