extcap: Fix Dereference of null pointer
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Mon, 15 Aug 2016 17:25:15 +0000 (19:25 +0200)
committerPascal Quantin <pascal.quantin@gmail.com>
Mon, 15 Aug 2016 20:52:07 +0000 (20:52 +0000)
Change-Id: I03098de9bd8684953a4fe024a3e6b604eeecf03f
Reviewed-on: https://code.wireshark.org/review/17066
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
extcap.c

index 7747d72a85ad37c3a914a2cba9bc59f9c2ba9b08..28312a01a1d6484a5e6e74fa166faf967049bc34 100644 (file)
--- a/extcap.c
+++ b/extcap.c
@@ -765,21 +765,18 @@ void extcap_if_cleanup(capture_options * capture_opts, gchar ** errormsg) {
                 }
                 g_free(buffer);
             }
-        }
 
 #ifndef _WIN32
-        /* Final child watch may not have been called */
-        if ( interface_opts.extcap_child_watch != 0 )
-        {
-            extcap_child_watch_cb(userdata->pid, 0, capture_opts);
-            /* it will have changed in extcap_child_watch_cb */
-            interface_opts = g_array_index(capture_opts->ifaces, interface_options,
-                            icnt);
-        }
+            /* Final child watch may not have been called */
+            if ( interface_opts.extcap_child_watch != 0 )
+            {
+                extcap_child_watch_cb(userdata->pid, 0, capture_opts);
+                /* it will have changed in extcap_child_watch_cb */
+                interface_opts = g_array_index(capture_opts->ifaces, interface_options,
+                                icnt);
+            }
 #endif
 
-        if ( userdata )
-        {
             if ( userdata->extcap_stderr != NULL )
                 overwrite_exitcode = TRUE;