Qt: Fix a memory leak in ByteViewTab

FieldInformation::parentField() allocated a new FieldInformation,
so ensure to delete this when done.

Change-Id: Id0f538cc696551ec47169103be823eb1e55d1777
Reviewed-on: https://code.wireshark.org/review/36823
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
This commit is contained in:
Stig Bjørlykke 2020-04-13 13:34:59 +02:00 committed by Martin Kaiser
parent 55920e64e5
commit 1f6449c05d
1 changed files with 6 additions and 2 deletions

View File

@ -302,10 +302,14 @@ void ByteViewTab::selectedFieldChanged(FieldInformation *selected)
setCurrentIndex(idx);
p_start = selected->parentField()->position().start;
p_length = selected->parentField()->position().length;
FieldInformation *parentField = selected->parentField();
p_start = parentField->position().start;
p_length = parentField->position().length;
fa_start = selected->appendix().start;
fa_length = selected->appendix().length;
delete parentField;
}
if (byte_view_text)