aboutsummaryrefslogtreecommitdiffstats
path: root/extcap_spawn.c
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@gmail.com>2016-09-08 14:26:58 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-09-12 12:13:41 +0000
commitc64762d33c3a9cbc4af4040284534b440d12b210 (patch)
treecd1f29e92e31ba93e19281575a1b8d4eeda7fd51 /extcap_spawn.c
parente079862fad331cba874717ec1d0af9e35ba438b5 (diff)
extcap: Fix misc memory leaks triggered by network interface changes
Valgrind reports plenty of misc memory leaks in extcap after the network interface list has changed or is refreshed. Errors can be seen by starting Wireshark with Valgrind's memcheck tool and bringing a network interface up and down a few times with: ifconfig eth0 up ifconfig eth0 down Change-Id: I90f53847071854b7d02facb39b7a380732de79b4 Reviewed-on: https://code.wireshark.org/review/17606 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'extcap_spawn.c')
-rw-r--r--extcap_spawn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/extcap_spawn.c b/extcap_spawn.c
index 484269370c..7a3984dd21 100644
--- a/extcap_spawn.c
+++ b/extcap_spawn.c
@@ -122,6 +122,7 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
if (!CreatePipe(&child_stdout_rd, &child_stdout_wr, &sa, 0))
{
+ g_free(argv[0]);
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Could not create stdout handle");
return FALSE;
}
@@ -130,6 +131,7 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
{
CloseHandle(child_stdout_rd);
CloseHandle(child_stdout_wr);
+ g_free(argv[0]);
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Could not create stderr handle");
return FALSE;
}
@@ -192,6 +194,7 @@ gboolean extcap_spawn_sync ( gchar * dirname, gchar * command, gint argc, gchar
}
g_free(local_output);
+ g_free(argv[0]);
g_free(argv);
return result;