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 /test | |
parent | 5fb897077e77c43d0080618d338443a8d62e5663 (diff) | |
download | wireshark-551745998ef4a9352bca2a0035780bc1a96e55eb.tar.gz wireshark-551745998ef4a9352bca2a0035780bc1a96e55eb.tar.bz2 wireshark-551745998ef4a9352bca2a0035780bc1a96e55eb.zip |
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 'test')
-rw-r--r-- | test/lua/protofield.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lua/protofield.lua b/test/lua/protofield.lua index 1cfc9fa184..2fcfafb2fd 100644 --- a/test/lua/protofield.lua +++ b/test/lua/protofield.lua @@ -79,7 +79,7 @@ test("ProtoField-char", success) success = pcall(ProtoField.new, "char base NONE without valuestring", "test.char1", ftypes.CHAR, nil, base.NONE) test("ProtoField-char-without-valuestring", not success) -success, test_proto.fields.char2 = pcall(ProtoField.new, "char base NONE with valuestring", "test.char2", ftypes.CHAR, {1, "Value"}, base.NONE) +success = pcall(ProtoField.new, "char base NONE with valuestring", "test.char2", ftypes.CHAR, {1, "Value"}, base.NONE) test("ProtoField-char-with-valuestring", success) success = pcall(ProtoField.new, "char base DEC", "test.char3", ftypes.CHAR, nil, base.DEC) @@ -88,7 +88,7 @@ test("ProtoField-char-base-dec", not success) success = pcall(ProtoField.new, "char base UNIT_STRING", "test.char4", ftypes.CHAR, {" m"}, base.UNIT_STRING) test("ProtoField-char-unit-string", not success) -success, test_proto.fields.char5 = pcall(ProtoField.new, "char base RANGE_STRING", "test.char5", ftypes.CHAR, {{1, 2, "Value"}}, base.RANGE_STRING) +success = pcall(ProtoField.new, "char base RANGE_STRING", "test.char5", ftypes.CHAR, {{1, 2, "Value"}}, base.RANGE_STRING) test("ProtoField-char-range-string", success) -- Field name: empty, illegal, incompatible |