Fixed a svace 31139
[platform/core/api/wifi.git] / test / wifi_test.c
index a3cfddc..baf0d06 100755 (executable)
@@ -1537,9 +1537,9 @@ int test_wifi_tdls_disconnect(void)
 {
        int rv = 0;
 
-       char * peer_mac = NULL;
+       char peer_mac[18];
        printf("Enter Mac_address: ");
-       if(scanf(" %ms", &peer_mac) < 1)
+       if(scanf(" %17s", peer_mac) < 1)
                return -1;
 
        if (strlen(peer_mac) > 17)
@@ -1551,10 +1551,8 @@ int test_wifi_tdls_disconnect(void)
        rv = wifi_tdls_disconnect(peer_mac);
        if (rv != WIFI_ERROR_NONE) {
                printf("test_wifi_tdls_disconnect() is failed [%s]\n", __test_convert_error_to_string(rv));
-               g_free(peer_mac);
                return -1;
        }
-       g_free(peer_mac);
        return 1;
 }