WIFI_LOG(WIFI_INFO, "%s : %s\n", WIFI_MAC_ADDR_PATH, buf);
- *mac_address = (char *)g_try_malloc0(WIFI_MAC_ADDR_LENGTH + 1);
+ *mac_address = strndup(buf, WIFI_MAC_ADDR_LENGTH + 1);
if (*mac_address == NULL) {
- WIFI_LOG(WIFI_ERROR, "malloc() failed"); //LCOV_EXCL_LINE
+ WIFI_LOG(WIFI_ERROR, "strndup() failed"); //LCOV_EXCL_LINE
fclose(fp); //LCOV_EXCL_LINE
return WIFI_MANAGER_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
- g_strlcpy(*mac_address, buf, WIFI_MAC_ADDR_LENGTH + 1);
+
fclose(fp);
#else
*mac_address = vconf_get_str(VCONFKEY_WIFI_BSSID_ADDRESS);