aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_map.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-08-06 11:23:55 -0700
committerGerald Combs <gerald@wireshark.org>2015-08-06 21:22:13 +0000
commitff24ecceb976e25cf58040b116f25fc218290540 (patch)
treeb6568500814f3dde7bd88e3433af58c503ba9693 /epan/dissectors/packet-gsm_map.c
parent9fd3bcc25e0b6c1feaf6e20850200de4acf5637a (diff)
Fixup stat_tap table freeing.
As it turns out we *do* need to free table elements. We also need to free the tables themselves and clear the table array. Do so. Change-Id: Ic1c81388eac8f47f74caea0169c79685a83aaff9 Reviewed-on: https://code.wireshark.org/review/9901 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/dissectors/packet-gsm_map.c')
-rw-r--r--epan/dissectors/packet-gsm_map.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c
index 366d95a01f..1b28ec5029 100644
--- a/epan/dissectors/packet-gsm_map.c
+++ b/epan/dissectors/packet-gsm_map.c
@@ -22519,10 +22519,15 @@ void gsm_map_stat_init(new_stat_tap_ui* new_stat, new_stat_tap_gui_init_cb gui_c
for (i = 0; i < GSM_MAP_MAX_NUM_OPR_CODES; i++)
{
const char *ocs = try_val_to_str(i, gsm_map_opr_code_strings);
- if (!ocs) ocs = g_strdup_printf("Unknown op code %d", i);
+ char *col_str;
+ if (ocs) {
+ col_str = g_strdup(ocs);
+ } else {
+ col_str = g_strdup_printf("Unknown op code %d", i);
+ }
items[ID_COLUMN].value.uint_value = i;
- items[OP_CODE_COLUMN].value.string_value = ocs;
+ items[OP_CODE_COLUMN].value.string_value = col_str;
new_stat_tap_init_table_row(table, i, num_fields, items);
}
}
@@ -22599,6 +22604,13 @@ gsm_map_stat_reset(new_stat_tap_table* table)
}
}
+static void
+gsm_map_stat_free_table_item(new_stat_tap_table* table _U_, guint row _U_, guint column, stat_tap_table_item_type* field_data)
+{
+ if (column != OP_CODE_COLUMN) return;
+ g_free((char*)field_data->value.string_value);
+}
+
/*--- proto_reg_handoff_gsm_map ---------------------------------------*/
static void range_delete_callback(guint32 ssn)
{
@@ -29840,7 +29852,7 @@ void proto_register_gsm_map(void) {
NULL, HFILL }},
/*--- End of included file: packet-gsm_map-hfarr.c ---*/
-#line 3039 "../../asn1/gsm_map/packet-gsm_map-template.c"
+#line 3051 "../../asn1/gsm_map/packet-gsm_map-template.c"
};
/* List of subtrees */
@@ -30555,7 +30567,7 @@ void proto_register_gsm_map(void) {
&ett_NokiaMAP_Extensions_AllowedServiceData,
/*--- End of included file: packet-gsm_map-ettarr.c ---*/
-#line 3073 "../../asn1/gsm_map/packet-gsm_map-template.c"
+#line 3085 "../../asn1/gsm_map/packet-gsm_map-template.c"
};
static ei_register_info ei[] = {
@@ -30586,7 +30598,7 @@ void proto_register_gsm_map(void) {
gsm_map_stat_init,
gsm_map_stat_packet,
gsm_map_stat_reset,
- NULL,
+ gsm_map_stat_free_table_item,
NULL,
sizeof(gsm_map_stat_fields)/sizeof(stat_tap_table_item), gsm_map_stat_fields,
sizeof(gsm_map_stat_params)/sizeof(tap_param), gsm_map_stat_params,
@@ -30677,7 +30689,7 @@ void proto_register_gsm_map(void) {
/*--- End of included file: packet-gsm_map-dis-tab.c ---*/
-#line 3129 "../../asn1/gsm_map/packet-gsm_map-template.c"
+#line 3141 "../../asn1/gsm_map/packet-gsm_map-template.c"
oid_add_from_string("ericsson-gsm-Map-Ext","1.2.826.0.1249.58.1.0" );
oid_add_from_string("accessTypeNotAllowed-id","1.3.12.2.1107.3.66.1.2");
/*oid_add_from_string("map-ac networkLocUp(1) version3(3)","0.4.0.0.1.0.1.3" );