diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2019-10-28 09:52:12 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-10-28 15:05:54 +0000 |
commit | 551745998ef4a9352bca2a0035780bc1a96e55eb (patch) | |
tree | 8476113202bfff9b4fd37038bb1c6a3173295cd2 /epan/wslua/wslua_proto_field.c | |
parent | 5fb897077e77c43d0080618d338443a8d62e5663 (diff) |
wslua: Fix memleak of unregistered ProtoField strings
If a ProtoField object was created, but not linked to a Proto, then the
strings field and all elements (depending on type) would leak.
This is a follow-up to g79fef2ae and fixes the real issue in g44870fb1.
Change-Id: I01880a92bb20fae45f68c754b07daeb07630deec
Reviewed-on: https://code.wireshark.org/review/34872
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'epan/wslua/wslua_proto_field.c')
-rw-r--r-- | epan/wslua/wslua_proto_field.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/wslua/wslua_proto_field.c b/epan/wslua/wslua_proto_field.c index c050cdefbc..0a8394704f 100644 --- a/epan/wslua/wslua_proto_field.c +++ b/epan/wslua/wslua_proto_field.c @@ -1462,10 +1462,11 @@ static int ProtoField__gc(lua_State* L) { return 0; } - /* Note: name, abbrev and blob will be NULL after Proto deregistration. */ + /* Note: name, abbrev, blob and vs will be NULL after Proto deregistration. */ g_free(f->name); g_free(f->abbrev); g_free(f->blob); + proto_free_field_strings(f->type, f->base, f->vs); g_free(f); return 0; |