sharkd: free initalized wtap_rec when wtap failed to read frame.

Change-Id: I564a3704c0ea1b0df85f3cafacf790ed24591232
Reviewed-on: https://code.wireshark.org/review/30086
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
This commit is contained in:
Jakub Zawadzki 2018-10-08 22:50:41 +02:00
parent 420c4ecc56
commit 988b14ad72
1 changed files with 2 additions and 0 deletions

View File

@ -544,6 +544,7 @@ sharkd_dissect_request(guint32 framenum, guint32 frame_ref_num, guint32 prev_dis
ws_buffer_init(&buf, 1500);
if (!wtap_seek_read(cfile.provider.wth, fdata->file_off, &rec, &buf, &err, &err_info)) {
wtap_rec_cleanup(&rec);
ws_buffer_free(&buf);
return -1; /* error reading the record */
}
@ -604,6 +605,7 @@ sharkd_dissect_columns(frame_data *fdata, guint32 frame_ref_num, guint32 prev_di
if (!wtap_seek_read(cfile.provider.wth, fdata->file_off, &rec, &buf, &err, &err_info)) {
col_fill_in_error(cinfo, fdata, FALSE, FALSE /* fill_fd_columns */);
wtap_rec_cleanup(&rec);
ws_buffer_free(&buf);
return -1; /* error reading the record */
}