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:
parent
aa90f741bc
commit
768a746ede
12
ui/capture.c
12
ui/capture.c
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue