Fix appending the list of remote interfaces.
authorGuy Harris <guy@alum.mit.edu>
Sat, 27 Feb 2016 01:14:52 +0000 (17:14 -0800)
committerGuy Harris <guy@alum.mit.edu>
Sat, 27 Feb 2016 02:04:00 +0000 (02:04 +0000)
Don't assume if_list is non-null when append_remote_list() is called; it
won't be, if we didn't find any local interfaces.  Have
append_remote_list() return the final if_list value, and assign it to
if_list.

Change-Id: I05586d5b034f3d61aa38a20f6c6d2c69117b367e
Reviewed-on: https://code.wireshark.org/review/14191
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
capchild/capture_ifinfo.c

index 3d848814d99e0d04404e3b5bf4ea6bc0aeabca3a..8e4c59fa4ec650c44ce5ff1393d129cbe6d8f2f0 100644 (file)
@@ -45,7 +45,7 @@
 #ifdef HAVE_PCAP_REMOTE
 static GList *remote_interface_list = NULL;
 
-static void append_remote_list(GList *iflist)
+static GList * append_remote_list(GList *iflist)
 {
     GSList *list;
     GList *rlist;
@@ -79,6 +79,7 @@ static void append_remote_list(GList *iflist)
         temp->loopback = if_info->loopback;
         iflist = g_list_append(iflist, temp);
    }
+   return iflist;
 }
 #endif
 
@@ -193,7 +194,7 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void))
 
 #ifdef HAVE_PCAP_REMOTE
     if (remote_interface_list && g_list_length(remote_interface_list) > 0) {
-        append_remote_list(if_list);
+        if_list = append_remote_list(if_list);
     }
 #endif