From: Cheoleun Moon Date: Tue, 9 Feb 2021 01:53:29 +0000 (+0900) Subject: Fix svace issues (PASSED_TO_PROC_AFTER_FREE) X-Git-Tag: submit/tizen/20210209.032013^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ca5d68a0fb8d7fbd03e1adb41786fda5cb5f7d1;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Fix svace issues (PASSED_TO_PROC_AFTER_FREE) Change-Id: I04291e7becbe78ed82a16a6fefbafb5c42a5b6b0 --- diff --git a/tool/wifi_mgr_tool.c b/tool/wifi_mgr_tool.c index 1b53892..19a46d4 100755 --- a/tool/wifi_mgr_tool.c +++ b/tool/wifi_mgr_tool.c @@ -260,6 +260,7 @@ static int _test_wifi_mgr_initialize(MManager *mm, struct menu_data *menu) } else { msg("[1] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END, test_wifi_mgr_convert_error_to_string(ret)); + return ret; } ret = wifi_manager_initialize(&g_wifi2_h); @@ -283,21 +284,20 @@ static int _test_wifi_mgr_initialize(MManager *mm, struct menu_data *menu) } else { msg("[2] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END, test_wifi_mgr_convert_error_to_string(ret)); + return ret; } + ret = wifi_manager_is_activated(g_wifi_h, &state); + wifi_manager_get_network_interface_name(g_wifi_h, &if_name); if (ret == WIFI_MANAGER_ERROR_NONE) { - ret = wifi_manager_is_activated(g_wifi_h, &state); - wifi_manager_get_network_interface_name(g_wifi_h, &if_name); - if (ret == WIFI_MANAGER_ERROR_NONE) { - g_device_state = state; - msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name, + g_device_state = state; + msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name, test_wifi_mgr_device_state_to_string(g_device_state)); - } else { - msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END, + } else { + msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END, test_wifi_mgr_convert_error_to_string(ret)); - } - FREE(if_name); } + FREE(if_name); return ret; } @@ -420,6 +420,7 @@ static int _test_wifi_mgr_initialize_with_ifname(MManager *mm, struct menu_data } else { msg("[1] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END, test_wifi_mgr_convert_error_to_string(ret)); + return ret; } ret = wifi_manager_initialize_with_interface_name(&g_wifi2_h, g_ifname); @@ -443,21 +444,20 @@ static int _test_wifi_mgr_initialize_with_ifname(MManager *mm, struct menu_data } else { msg("[2] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END, test_wifi_mgr_convert_error_to_string(ret)); + return ret; } + ret = wifi_manager_is_activated(g_wifi_h, &state); + wifi_manager_get_network_interface_name(g_wifi_h, &if_name); if (ret == WIFI_MANAGER_ERROR_NONE) { - ret = wifi_manager_is_activated(g_wifi_h, &state); - wifi_manager_get_network_interface_name(g_wifi_h, &if_name); - if (ret == WIFI_MANAGER_ERROR_NONE) { - g_device_state = state; - msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name, + g_device_state = state; + msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name, test_wifi_mgr_device_state_to_string(g_device_state)); - } else { - msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END, + } else { + msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END, test_wifi_mgr_convert_error_to_string(ret)); - } - FREE(if_name); } + FREE(if_name); return ret; }