aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/epan/mate/mate_parser.l7
-rw-r--r--plugins/epan/mate/mate_runtime.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/plugins/epan/mate/mate_parser.l b/plugins/epan/mate/mate_parser.l
index 339b0cc4a2..2b61c9d069 100644
--- a/plugins/epan/mate/mate_parser.l
+++ b/plugins/epan/mate/mate_parser.l
@@ -339,6 +339,11 @@ blk_cmnt_stop "*/"
*/
DIAG_ON_FLEX
+static void ptr_array_free(gpointer data, gpointer user_data _U_)
+{
+ free_config_frame((mate_config_frame *)data);
+}
+
extern gboolean mate_load_config(const gchar* filename, mate_config* mc) {
FILE *in;
yyscan_t scanner;
@@ -397,7 +402,7 @@ extern gboolean mate_load_config(const gchar* filename, mate_config* mc) {
Mate_lex_destroy(scanner);
fclose(in);
- g_ptr_array_foreach(mc->config_stack, (GFunc)free_config_frame, NULL);
+ g_ptr_array_foreach(mc->config_stack, ptr_array_free, NULL);
g_ptr_array_free(mc->config_stack, FALSE);
return status;
diff --git a/plugins/epan/mate/mate_runtime.c b/plugins/epan/mate/mate_runtime.c
index e5f501dda9..293f4ce6f7 100644
--- a/plugins/epan/mate/mate_runtime.c
+++ b/plugins/epan/mate/mate_runtime.c
@@ -691,6 +691,11 @@ static void get_pdu_fields(gpointer k, gpointer v, gpointer p) {
}
}
+static void ptr_array_free(gpointer data, gpointer user_data _U_)
+{
+ g_free(data);
+}
+
static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto, proto_tree* tree) {
mate_pdu* pdu = (mate_pdu*)g_slice_new(mate_max_size);
field_info* cfi;
@@ -813,7 +818,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_foreach(data.ranges, ptr_array_free, NULL);
g_ptr_array_free(data.ranges,TRUE);
return pdu;