wireshark: Free the if_stat_cache_t when dumpcap is not forked

Fixes ASAN test failures for test_wireshark_capture_from_stdin and
test_wireshark_capture_from_fifo tests.

Change-Id: I196fe2a299761f95e07b3091b934a566403e3e3f
Reviewed-on: https://code.wireshark.org/review/31844
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Vasil Velichkov 2019-01-31 18:49:33 +02:00 committed by Peter Wu
parent aa90f741bc
commit 768a746ede
1 changed files with 7 additions and 5 deletions

View File

@ -878,14 +878,16 @@ capture_stat_stop(if_stat_cache_t *sc)
int ret;
gchar *msg;
if (!sc || sc->fork_child == WS_INVALID_PID) {
if (!sc) {
return;
}
ret = sync_interface_stats_close(&sc->stat_fd, &sc->fork_child, &msg);
if (ret == -1) {
/* XXX - report failure? */
g_free(msg);
if (sc->fork_child != WS_INVALID_PID) {
ret = sync_interface_stats_close(&sc->stat_fd, &sc->fork_child, &msg);
if (ret == -1) {
/* XXX - report failure? */
g_free(msg);
}
}
for (sc_entry = sc->cache_list; sc_entry != NULL; sc_entry = g_list_next(sc_entry)) {