summaryrefslogtreecommitdiff
path: root/epan/packet.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-03-11 20:54:26 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2016-03-13 10:51:44 +0000
commit6f220a343e476fb1df1f98c719b0fedf5c4f8c7f (patch)
treecf194b9f75ad4075bef39b2fb082bcb26ab552a4 /epan/packet.c
parentb46d55551fbdab486b2142f393b13c56f2ff3204 (diff)
downloadwireshark-6f220a343e476fb1df1f98c719b0fedf5c4f8c7f.tar.gz
Lua: Remove heur dissectors when reload Lua plugins
When reloading Lua plugins all registered heuristic dissectors must be removed. Bug: 12251 Change-Id: Ib7da6df347fb9294f5394ae531b582bf6d2730bb Reviewed-on: https://code.wireshark.org/review/14429 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/packet.c b/epan/packet.c
index f8066dedeb..0092097b67 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -2261,14 +2261,15 @@ heur_dissector_delete(const char *name, heur_dissector_t dissector, const int pr
g_assert(sub_dissectors != NULL);
hdtbl_entry.dissector = dissector;
-
hdtbl_entry.protocol = find_protocol_by_id(proto);
found_entry = g_slist_find_custom(sub_dissectors->dissectors,
(gpointer) &hdtbl_entry, find_matching_heur_dissector);
if (found_entry) {
- g_free(((heur_dtbl_entry_t *)(found_entry->data))->list_name);
+ heur_dtbl_entry_t *found_hdtbl_entry = (heur_dtbl_entry_t *)(found_entry->data);
+ g_free(found_hdtbl_entry->list_name);
+ g_hash_table_remove(heuristic_short_names, (gpointer)found_hdtbl_entry->short_name);
g_slice_free(heur_dtbl_entry_t, found_entry->data);
sub_dissectors->dissectors = g_slist_delete_link(sub_dissectors->dissectors,
found_entry);