Fixed a coverity for resource leak 80/176380/2
authorJaehyun Kim <jeik01.kim@samsung.com>
Thu, 19 Apr 2018 02:39:39 +0000 (11:39 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Thu, 19 Apr 2018 04:03:34 +0000 (13:03 +0900)
Change-Id: I0892e107ea2216aaed04490ae938156ac15dbf91
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
test/wifi_manager_test.c

index bf3ae36c5f33b791f5f68fd3565913454667e8c0..635b966a972c68259560807dbc11603cf06617a0 100755 (executable)
@@ -818,6 +818,7 @@ static bool __test_found_change_ip_method_callback(wifi_manager_ap_h ap, void *u
                                        "- (Enter for skip) : ", &dns_type);
                        if (rv == false) {
                                printf("Invalid input!!\n");
+                               g_free(ap_name);
                                return false;
                        }
                        switch (dns_type) {
@@ -845,8 +846,10 @@ static bool __test_found_change_ip_method_callback(wifi_manager_ap_h ap, void *u
                                                        break;
                                                }
                                        }
-                                       if (rv != WIFI_MANAGER_ERROR_NONE)
+                                       if (rv != WIFI_MANAGER_ERROR_NONE) {
+                                               g_free(ap_name);
                                                return -1;
+                                       }
 
                                        printf("Input DNS2 address (x: skip, 0: clear) : \n");
                                        if (address_type == WIFI_MANAGER_ADDRESS_FAMILY_IPV4)