epan: Removed an unneeded g_malloc.

Change-Id: Ibc8b2651e2f56ecfdf9d00b235c39b6ac43b38b3
Reviewed-on: https://code.wireshark.org/review/12017
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2015-11-21 19:40:40 +01:00
parent f1efeb1eba
commit 23258fb841
1 changed files with 3 additions and 6 deletions

View File

@ -5379,7 +5379,7 @@ proto_deregister_protocol(const char *short_name)
protocol_t *protocol;
header_field_info *hfinfo;
int proto_id;
gint *key;
gint key;
guint i;
proto_id = proto_get_id_by_short_name(short_name);
@ -5387,11 +5387,8 @@ proto_deregister_protocol(const char *short_name)
if (protocol == NULL)
return FALSE;
key = (gint *)g_malloc(sizeof(gint));
*key = wrs_str_hash(protocol->name);
g_hash_table_remove(proto_names, key);
g_free(key);
key = wrs_str_hash(protocol->name);
g_hash_table_remove(proto_names, &key);
g_hash_table_remove(proto_short_names, (gpointer)short_name);
g_hash_table_remove(proto_filter_names, (gpointer)protocol->filter_name);