k12: plug a memory leak.

If the two putative number-of-records values don't match (meaning one of
them is presumably the number of records and the other one isn't - we
don't know which is the case), free up the private data structure we
allocated before returning an error.
This commit is contained in:
Guy Harris 2021-05-23 23:14:27 -07:00
parent 297b6c5407
commit 7f6c5d0137
1 changed files with 1 additions and 0 deletions

View File

@ -888,6 +888,7 @@ wtap_open_return_val k12_open(wtap *wth, int *err, gchar **err_info) {
K12_FILE_HDR_RECORD_COUNT_1,
pntoh32( header_buffer + K12_FILE_HDR_RECORD_COUNT_2 ),
K12_FILE_HDR_RECORD_COUNT_2 );
destroy_k12_file_data(file_data);
return WTAP_OPEN_ERROR;
}
}