Wiretap: Fix a resource leak

call destroy_k12_file_data to destory file_data before return.
This commit is contained in:
yuanjungong 2021-06-09 09:17:44 +08:00 committed by Gerald Combs
parent 391c4ef517
commit ca42e4a9ad
1 changed files with 1 additions and 0 deletions

View File

@ -927,6 +927,7 @@ wtap_open_return_val k12_open(wtap *wth, int *err, gchar **err_info) {
*err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup_printf("k12: record length %u < %u",
rec_len, K12_RECORD_TYPE + 4);
destroy_k12_file_data(file_data);
return WTAP_OPEN_ERROR;
}
type = pntoh32( read_buffer + K12_RECORD_TYPE );