Modified way of update rssi value
[platform/core/connectivity/net-config.git] / src / wifi-eap-config.c
index adaa63d..49283ba 100755 (executable)
@@ -94,7 +94,7 @@ static int __config_save(const char *ssid, GKeyFile *keyfile)
 
        /* 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;
@@ -347,12 +347,6 @@ out:
 
        g_variant_iter_free(iter);
 
-       if (field)
-               g_free(field);
-
-       if (value)
-               g_free(value);
-
        g_free(group_name);
        g_free(encoded_ssid);
 
@@ -372,13 +366,11 @@ static gboolean _delete_configuration(const gchar *profile)
        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;
 }
@@ -397,9 +389,8 @@ static gboolean __netconfig_delete_config(const char *profile)
                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) {