From: Seonah Moon Date: Mon, 2 Jan 2017 02:21:06 +0000 (+0900) Subject: [TSAM-12289] Retrun error when MAC address is empty X-Git-Tag: submit/tizen_3.0/20170102.045943^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_3.0.m2;p=platform%2Fcore%2Fapi%2Fwifi-manager.git [TSAM-12289] Retrun error when MAC address is empty Change-Id: If0740adab0d170b12cc7cfd630759b2df0ec9306 Signed-off-by: Seonah Moon --- diff --git a/packaging/capi-network-wifi-manager.spec b/packaging/capi-network-wifi-manager.spec index f2b633e..9364d40 100755 --- a/packaging/capi-network-wifi-manager.spec +++ b/packaging/capi-network-wifi-manager.spec @@ -1,6 +1,6 @@ Name: capi-network-wifi-manager Summary: Network Wi-Fi library in TIZEN C API -Version: 1.0.12 +Version: 1.0.13 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/wifi_manager.c b/src/wifi_manager.c index 9e23c75..8cc6bcb 100755 --- a/src/wifi_manager.c +++ b/src/wifi_manager.c @@ -296,9 +296,13 @@ EXPORT_API int wifi_manager_get_mac_address(wifi_manager_h wifi, char **mac_addr #else *mac_address = vconf_get_str(VCONFKEY_WIFI_BSSID_ADDRESS); - if (*mac_address == NULL) { + if (*mac_address == NULL || strlen(*mac_address) == 0) { WIFI_LOG(WIFI_ERROR, "Failed to get vconf" //LCOV_EXCL_LINE " from %s", VCONFKEY_WIFI_BSSID_ADDRESS); + if (*mac_address) { + free(*mac_address); + *mac_address = NULL; + } return WIFI_MANAGER_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } #endif