Wireshark-commits: [Wireshark-commits] master 0b63286: dumpcap: fix memory leak in ringbuffer mode
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=0b632861e21222513fac38487a56e442a4aac2fb
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark
Commits:
0b63286 by Peter Wu (peter@xxxxxxxxxxxxx):
dumpcap: fix memory leak in ringbuffer mode
'save_file' is used both for holding the -w command-line argument as
well as the current filename that is being written. In ringbuffer mode,
the former is already freed while the latter changes after rotation. Be
sure to free all ringbuffer filenames on exit.
Fixes test failures due to ASAN reporting memory leaks for:
test_dumpcap_ringbuffer_filesize
test_dumpcap_pcapng_single_in_multi_out
test_dumpcap_pcapng_multi_in_multi_out
test_dumpcap_ringbuffer_packets
Change-Id: Ib817d8340275d7afa7e149dcfbbc59ed78293c34
Reviewed-on: https://code.wireshark.org/review/31739
Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
Actions performed:
from 728183c wslua_file_handler: fix leak of opt_comment
add 0b63286 dumpcap: fix memory leak in ringbuffer mode
Summary of changes:
dumpcap.c | 27 ++++++++++++++++++++-------
ringbuffer.c | 12 +++++++++++-
ringbuffer.h | 3 ++-
3 files changed, 33 insertions(+), 9 deletions(-)