diff options
author | Peter Wu <peter@lekensteyn.nl> | 2019-01-25 22:55:24 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-01-27 09:43:05 +0000 |
commit | 03e13a6a9fbba7cad7dbc00a1fe1b6eb44b1c16c (patch) | |
tree | 96fbf28e5e87d56ea2c281c66ec9fdd3c7a4821d /epan/proto.c | |
parent | 311d087bbdec5e6a93d740327fdff82ad6a13dde (diff) |
wslua: fix memleaks related to Proto and Pref
Proto objects were only freed while reloading Lua plugins, be sure to
release these on program exit too. Fix missing deallocation of heur_list
(matches per-protocol cleanup in proto_cleanup_base).
Be sure to keep a reference to the "Pref" object after registering it to
a Proto, otherwise it could be garbage-collected early, resulting in
memleaks (because the preference was still in use).
Fixes a lot of memory leaks reported by ASAN for tests, ten tests were
affected by Proto_new leaks, four were affected by the new_pref leaks.
Change-Id: Ica52718849a33eda614775f533dc0fcefec9cc74
Reviewed-on: https://code.wireshark.org/review/31746
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/proto.c b/epan/proto.c index 0cbd6bfddb..02b0cc4567 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -6846,6 +6846,8 @@ proto_deregister_protocol(const char *short_name) protocol->fields = NULL; } + g_list_free(protocol->heur_list); + /* Remove this protocol from the list of known protocols */ protocols = g_list_remove(protocols, protocol); |