path: root/extcap.c
diff options
authorMikael Kanstrup <mikael.kanstrup@gmail.com>2016-01-31 20:55:55 +0100
committerRoland Knall <rknall@gmail.com>2016-02-01 20:36:37 +0000
commita53ab9dfcc87ec817467a2a9c2259b0a70a1dd78 (patch)
tree3fb9f729cdf32f566ff2c1babe7c9d93f6f7831e /extcap.c
parent14d6c205bd390481ef2de1bc1cce50216c3f2249 (diff)
Fix leaks when spawning extcap processes
Valgrind reports leaks like these when spawning extcap processes (for example when displaying or refreshing interface list with extcap interfaces present): 3,917 (464 direct, 3,453 indirect) bytes in 29 blocks are definitely lost in loss record 58,301 of 58,638 at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xA6D2610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA6E822D: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA6B913B: g_error_new_valist (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA6B94ED: g_set_error (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA710B03: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA710E17: g_spawn_sync (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0x44C677: extcap_foreach (extcap.c:199) by 0x44CCAD: extcap_interface_list (extcap.c:413) by 0x72B548: capture_interface_list (capture_ifinfo.c:126) by 0x7336FA: scan_local_interfaces (iface_lists.c:141) by 0x55F01F: WiresharkApplication::refreshLocalInterfaces() (wireshark_application.cpp:898) ... Change-Id: If8f750f5f8fa42a6f0884bb0e6bbbd71bd8f68aa Reviewed-on: https://code.wireshark.org/review/13631 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap.c')
1 files changed, 1 insertions, 2 deletions
diff --git a/extcap.c b/extcap.c
index a4e656f5bf..938042880a 100644
--- a/extcap.c
+++ b/extcap.c
@@ -177,7 +177,6 @@ static void extcap_foreach(gint argc, gchar **args, extcap_cb_t cb,
gchar *command_output = NULL;
gboolean status = FALSE;
gint exit_status = 0;
- GError *error = NULL;
gchar **envp = NULL;
/* full path to extcap binary */
@@ -201,7 +200,7 @@ static void extcap_foreach(gint argc, gchar **args, extcap_cb_t cb,
status = g_spawn_sync(dirname, argv, envp,
(GSpawnFlags) 0, NULL, NULL,
- &command_output, NULL, &exit_status, &error);
+ &command_output, NULL, &exit_status, NULL);
if (status && exit_status == 0)
keep_going = cb(extcap_path->str, ifname, command_output, cb_data, err_str);