/* Do POSIX file operation to create and remove config files,
* Do not use g_file_set_contents, it breaks inotify operations */
- if (fputs(data, file) < 0) {
+ if (data && fputs(data, file) < 0) {
ERR("Failed to write %s", config_file);
err = -EIO;
g_variant_iter_free(iter);
- if (field)
- g_free(field);
-
- if (value)
- g_free(value);
-
g_free(group_name);
g_free(encoded_ssid);
ERR("get config_id [%s] from [%s]", config_id, profile);
ret = wifi_config_remove_configuration(config_id);
- if (ret != TRUE) {
+ if (ret != TRUE)
ERR("Fail to wifi_config_remove_configuration [%s]", config_id);
- }
- if (config_id != NULL) {
+ if (config_id != NULL)
g_free(config_id);
- }
return ret;
}
return FALSE;
}
- if (_delete_configuration(profile) != TRUE) {
+ if (_delete_configuration(profile) != TRUE)
ERR("Fail to delete configuration [%s]", profile);
- }
wifi_ident = strstr(profile, "wifi_");
if (wifi_ident == NULL) {