epan: Check for valid cf->edt before free.

Added a check for a valid cf->edt before calling epan_dissect_free(),
as this will give an unintended assert.

This is related to da71ccbf77.

Change-Id: I7f7ceb1b25cfa2400063947f674df10ed6a93e9d
Reviewed-on: https://code.wireshark.org/review/11934
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2015-11-18 08:15:39 +01:00
parent 2cbb58366e
commit 8c211d51ef
1 changed files with 4 additions and 2 deletions

6
file.c
View File

@ -1623,8 +1623,10 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, gb
cf->redissecting = TRUE;
/* 'reset' dissection session */
epan_dissect_free(cf->edt);
cf->edt = NULL;
if (cf->edt) {
epan_dissect_free(cf->edt);
cf->edt = NULL;
}
epan_free(cf->epan);
cf->epan = ws_epan_new(cf);
cf->cinfo.epan = cf->epan;