aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mate/mate_runtime.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-06-30 00:38:45 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-06-29 22:56:21 +0000
commita36db750e4b9002c91899c7a9b774401f2de1b81 (patch)
treeb987dd16fdb47a17f1a3bd61b1d4d0d3106c712e /plugins/mate/mate_runtime.c
parent305d983442cb8969abcfce0858b5b919bfc4d629 (diff)
plugins/mate: fix some memleaks
Fixes about 5kB leaks in 500+ allocations. There are still some other remaining (and not fixed in this patch because it is hard to track them): - The g_strdup'ed memory via MATE_PARSE for some types (cannot simply g_free after use, it is still needed in some cases). - cfg->transforms and cfg->transport_ranges as used in pdu_decl (mate_grammar.lemon). Tested on a http capture with: tshark -o mate.config:tcp.mate -r ... where tcp.mate is from https://wiki.wireshark.org/Mate/GettingStarted?action=AttachFile&do=get&target=tcp.mate Change-Id: I4c06f948136fc30dfcdb56f7ac8a32a2326ae30d Reviewed-on: https://code.wireshark.org/review/9221 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'plugins/mate/mate_runtime.c')
-rw-r--r--plugins/mate/mate_runtime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mate/mate_runtime.c b/plugins/mate/mate_runtime.c
index eede6ede67..2fbd0db5aa 100644
--- a/plugins/mate/mate_runtime.c
+++ b/plugins/mate/mate_runtime.c
@@ -131,7 +131,7 @@ static void destroy_gogs_in_cfg(gpointer k _U_, gpointer v, gpointer p _U_) {
c->last_id = 0;
}
-extern void initialize_mate_runtime(void) {
+void initialize_mate_runtime(void) {
dbg_print (dbg,5,dbg_facility,"initialize_mate: entering");
@@ -826,6 +826,7 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto,
apply_transforms(pdu->cfg->transforms,pdu->avpl);
+ g_ptr_array_foreach(data.ranges, (GFunc)g_free, NULL);
g_ptr_array_free(data.ranges,TRUE);
return pdu;