Fix segfault if error getting scans.
authorRoy Marples <roy@marples.name>
Tue, 18 Aug 2009 11:05:32 +0000 (11:05 +0000)
committerRoy Marples <roy@marples.name>
Tue, 18 Aug 2009 11:05:32 +0000 (11:05 +0000)
src/libdhcpcd/wpa.c

index c85f486f363e81b53eadf4db301a16ffbcb5d0cc..f187984fe1b93158493eb37a54f9a6ca563b4e04 100644 (file)
@@ -134,6 +134,8 @@ dhcpcd_wi_scans(DHCPCD_CONNECTION *con, DHCPCD_IF *i)
        int errors, nh;
 
        msg = dhcpcd_message_reply(con, "ScanResults", i->ifname);
+       if (msg == NULL)
+               return NULL;
        if (!dbus_message_iter_init(msg, &args) ||
            dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_ARRAY)
        {