Fix dbus method return value #2
[platform/core/connectivity/net-config.git] / src / wifi-key-encryption.c
index d57bce1..cf40a8a 100755 (executable)
@@ -205,6 +205,7 @@ gchar* _netconfig_encrypt_passphrase(const gchar *passphrase)
                        g_free(origin_value));
 
        if (__netconfig_set_param_list_aes_gcm(param) == NULL) {
+               ckmc_param_list_free(param);
                g_free(origin_value);
                return NULL;
        }
@@ -261,6 +262,7 @@ static gchar* _netconfig_decrypt_passphrase(const gchar *enc_data)
                        g_free(ehexstr));
 
        if (__netconfig_set_param_list_aes_gcm(param) == NULL) {
+               ckmc_param_list_free(param);
                g_free(ehexstr);
                return NULL;
        }
@@ -306,7 +308,7 @@ gboolean handle_encrypt_passphrase(Wifi *wifi, GDBusMethodInvocation *context, c
        if ((wifi == NULL) || (passphrase == NULL)) {
                ERR("Invalid parameter");
                netconfig_error_invalid_parameter(context);
-               return FALSE;
+               return TRUE;
        }
 
        enc_data = _netconfig_encrypt_passphrase(passphrase);