Fix segfault if error getting scans.
authorRoy Marples <roy@marples.name>
Tue, 18 Aug 2009 11:03:23 +0000 (11:03 +0000)
committerRoy Marples <roy@marples.name>
Tue, 18 Aug 2009 11:03:23 +0000 (11:03 +0000)
src/dhcpcd-gtk/main.c

index f68cb1633b3d9e72e1a2a0362a634f7b3d16534b..c66243a1709e8ae2081b7628cf62a2c77ac38279 100644 (file)
@@ -279,6 +279,10 @@ scan_cb(DHCPCD_CONNECTION *con, DHCPCD_IF *i, _unused void *data)
 
        g_message(_("%s: Received scan results"), i->ifname);
        scans = dhcpcd_wi_scans(con, i);
+       if (scans == NULL) {
+               g_warning("%s: %s", i->ifname, dhcpcd_error(con));
+               dhcpcd_error_clear(con);
+       }
        for (w = wi_scans; w; w = w->next)
                if (w->connection == con && w->interface == i)
                        break;