diff options
author | Peter Wu <peter@lekensteyn.nl> | 2019-01-24 00:15:08 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-01-24 04:21:23 +0000 |
commit | 9d5ab211635e201692cc250732be50a234e03d1c (patch) | |
tree | 60fdeabff3c71f4196b7d62cd1c59c23f4fdf1aa /wiretap/wtap.c | |
parent | 9175a235a8d8b77a9734b757274129ef0f3d3e84 (diff) |
wiretap: fix leak of options_buf and document memory handling
Manually checked all callers of wtap_seek_read to ensure that
wtap_rec_cleanup is called. Added missing wtap_rec_cleanup to:
- Completion of sequential read: wtap_sequential_close
- Callers of wtap_seek_read:
- users of cf_read_record_r:
- PacketListRecord::dissect
This fixes one of the two ASAN memleak reports while running
test_tshark_z_expert_comment and test_text2pcap_sip_pcapng (the other is
about opt_comment which is still unfixed).
Vasil Velichkov also found this issue and came up with a similar fix.
Change-Id: I54a6aa70bfdb42a816d03ad4861d0ad821d0ef88
Reviewed-on: https://code.wireshark.org/review/31709
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r-- | wiretap/wtap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c index fe43e3b457..693999bbce 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -1195,6 +1195,8 @@ wtap_sequential_close(wtap *wth) wth->fh = NULL; } + wtap_rec_cleanup(&wth->rec); + if (wth->rec_data) { ws_buffer_free(wth->rec_data); g_free(wth->rec_data); |