} else if (g_strcmp0(key, "Powered") == 0) {
bvalue = g_variant_get_boolean(var);
DBG("Powered [%d]", bvalue);
- wifi_state_update_power_state(svalue, bvalue);
+ if (svalue)
+ wifi_state_update_power_state(svalue, bvalue);
} else if (g_strcmp0(key, "Connected") == 0) {
bvalue = g_variant_get_boolean(var);
DBG("Connected [%d]", bvalue);
- wifi_state_set_connected(svalue, bvalue);
- if (bvalue == TRUE)
- wifi_state_set_technology_state(svalue, NETCONFIG_WIFI_TECH_CONNECTED);
- else
- wifi_state_set_technology_state(svalue, NETCONFIG_WIFI_TECH_POWERED);
+ if (svalue) {
+ wifi_state_set_connected(svalue, bvalue);
+ if (bvalue == TRUE)
+ wifi_state_set_technology_state(svalue, NETCONFIG_WIFI_TECH_CONNECTED);
+ else
+ wifi_state_set_technology_state(svalue, NETCONFIG_WIFI_TECH_POWERED);
+ }
}
}
g_variant_iter_free(iter);
netconfig_setting_data[type].key, NULL);
}
+ g_strfreev(string_list);
g_string_free(string_str, TRUE);
}
}
gchar *needle = NULL, *directory = NULL;
directory = g_strdup(pathname);
- needle = g_strrstr(directory, "/");
+ if (directory == NULL) {
+ ERR("directory is NULL");
+ return;
+ }
+ needle = g_strrstr(directory, "/");
if (needle != NULL)
*needle = '\0';
- if (directory == NULL || (*directory) == '\0') {
+ if ((*directory) == '\0') {
g_free(directory);
ERR("directory is NULL");
return;