Send Dbus error message to upper layer
[platform/core/connectivity/net-config.git] / src / wifi-tdls.c
index d9b95e4..7b301fb 100755 (executable)
@@ -110,7 +110,7 @@ static gboolean _tdls_timer_discover_event(gpointer user_data)
 static GVariant * __netconfig_wifi_tdls_send_dbus_str(const char* method, const char *str)
 {
        GVariant *message = NULL;
-       const char *if_path = NULL;
+       char *if_path = NULL;
        GVariant *params = NULL;
 
        if_path = netconfig_wifi_get_supplicant_interface();
@@ -124,6 +124,7 @@ static GVariant * __netconfig_wifi_tdls_send_dbus_str(const char* method, const
        message = netconfig_invoke_dbus_method(SUPPLICANT_SERVICE,
                        if_path, SUPPLICANT_INTERFACE ".Interface", method, params);
 
+       g_free(if_path);
        INFO("TDLS Returned from Blocking method for Send DBUS Command");
        return message;
 }
@@ -183,7 +184,7 @@ gboolean handle_tdls_connect(Wifi *wifi, GDBusMethodInvocation *context,
                if (message == NULL) {
                        ERR(" TDLS : failed to connect !!!");
                        netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_INTERNAL, "FailTdlsConnect");
-                       return FALSE;
+                       return TRUE;
                }
 
                DBG("[TizenMW<--WPAS] TDLS DBUS Command sent successfully");
@@ -215,7 +216,7 @@ gboolean handle_tdls_discover(Wifi *wifi, GDBusMethodInvocation *context,
                ERR(" TDLS : failed to discover !!!");
                netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_INTERNAL, "FailTdlsDiscover");
                wifi_complete_tdls_discover(wifi, context, NETCONFIG_ERROR_TDLS_FAIL_DISCOVER);
-               return FALSE;
+               return TRUE;
        }
 
        DBG(" TDLS DBUS Command sent successfully");
@@ -253,7 +254,7 @@ gboolean handle_tdls_disconnect(Wifi *wifi, GDBusMethodInvocation *context,
                if (message == NULL) {
                        ERR(" TDLS : failed to disconnect !!!");
                        netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_INTERNAL, "FailTdlsDisconnect");
-                       return FALSE;
+                       return TRUE;
                }
 
                DBG("[TizenMW<--WPAS] TDLS DBUS Command sent successfully");
@@ -308,7 +309,7 @@ gboolean handle_tdls_channel_switch(Wifi *wifi, GDBusMethodInvocation *context,
        GVariant *message = NULL;
        GVariantBuilder *builder;
        GVariant *params;
-       const char *if_path = NULL;
+       char *if_path = NULL;
        unsigned char oper_class = 0;
 
        if (peer_mac_Addr == NULL) {
@@ -347,6 +348,7 @@ gboolean handle_tdls_channel_switch(Wifi *wifi, GDBusMethodInvocation *context,
        message = netconfig_invoke_dbus_method(SUPPLICANT_SERVICE,
                                if_path, SUPPLICANT_INTERFACE ".Interface", "TDLSChannelSwitch", params);
 
+       g_free(if_path);
        if (message == NULL) {
                ERR(" TDLS : Fail to Process TDLS Channel Switch Request !!!");
                wifi_complete_tdls_channel_switch(wifi, context,