aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/k12.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-05-23 23:14:27 -0700
committerGuy Harris <gharris@sonic.net>2021-05-23 23:14:27 -0700
commit7f6c5d0137c94bdc9f7b07ee249d1b3cc9396dd9 (patch)
tree1d96c9519047c58c73005de1c2c3080ee63d0444 /wiretap/k12.c
parent297b6c5407426aa33b197f0f5d280ce4c6c04dc3 (diff)
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.
Diffstat (limited to 'wiretap/k12.c')
-rw-r--r--wiretap/k12.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/wiretap/k12.c b/wiretap/k12.c
index b63e979964..dcf4ac92e0 100644
--- a/wiretap/k12.c
+++ b/wiretap/k12.c
@@ -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;
}
}