From 287221e8d9591bf252392ec34959e24c49fcd275 Mon Sep 17 00:00:00 2001 From: Mikael Kanstrup Date: Mon, 28 Aug 2017 15:26:42 +0200 Subject: [PATCH] Free interface_options elements on cleanup At shutdown the array keeping all interface_options is freed. The array elements however are not making valgrind and ASAN complain. Make sure the elements are freed on cleanup. Ping-Bug: 13864 Change-Id: If8b810ea5f4f11c5ce770a9ffa6c2c791bc561fe Reviewed-on: https://code.wireshark.org/review/23265 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- capture_opts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/capture_opts.c b/capture_opts.c index 899268a9fb..2b527afa53 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -138,6 +138,9 @@ capture_opts_cleanup(capture_options *capture_opts) return; if (capture_opts->ifaces) { + while (capture_opts->ifaces->len > 0) { + capture_opts_del_iface(capture_opts, 0); + } g_array_free(capture_opts->ifaces, TRUE); capture_opts->ifaces = NULL; }