if (!netconfig_is_cellular_internet_profile(profile)) {
DBG("connection is not a internet profile - stop to update the cellular state");
+ if (old_ip)
+ free(old_ip);
+ if (old_ip6)
+ free(old_ip6);
+ if (old_proxy)
+ free(old_proxy);
return;
}
else if (old_ip != NULL && strlen(old_ip) > 0)
netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "");
}
- g_free(old_ip);
+ if (old_ip)
+ free(old_ip);
if (g_strcmp0(old_ip6, ip_addr6) != 0 || old_ip6 == NULL) {
if (ip_addr6 != NULL)
else if (old_ip6 != NULL && strlen(old_ip6) > 0)
netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "");
}
- g_free(old_ip6);
+ if (old_ip6)
+ free(old_ip6);
if (g_strcmp0(old_proxy, proxy_addr) != 0) {
if (proxy_addr == NULL)
else
netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, proxy_addr);
}
- g_free(old_proxy);
+ if (old_proxy)
+ free(old_proxy);
netconfig_set_vconf_int(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, 1);
else
vconf_set_str(VCONFKEY_NETWORK_IP, value);
}
- g_free(old_ip);
+ free(old_ip);
}
}
}
else
vconf_set_str(VCONFKEY_NETWORK_IP6, value);
}
- g_free(old_ip6);
+ free(old_ip6);
}
}
}
fclose(fp);
return FALSE;
}
- tmp_mac = (char *)g_try_malloc0(WIFI_MAC_ADD_LENGTH + 1);
+ tmp_mac = (gchar *)malloc(WIFI_MAC_ADD_LENGTH + 1);
if (tmp_mac == NULL) {
ERR("malloc() failed");
*mac_address = NULL;
fclose(fp);
return FALSE;
}
+ memset(tmp_mac, 0, WIFI_MAC_ADD_LENGTH + 1);
g_strlcpy(tmp_mac, buf, WIFI_MAC_ADD_LENGTH + 1);
fclose(fp);
} else {
}
}
tmp = g_ascii_strdown(tmp_mac, (gssize)strlen(tmp_mac));
- g_free(tmp_mac);
+ free(tmp_mac);
while (tmp && tmp[i]) {
if (tmp[i] != ':')
mac[j++] = tmp[i];
if (__netconfig_get_random_mac(rand_mac_add, ETH_MAC_ADDR_SIZE) == -1) {
ERR("Could not generate the Random Mac address");
- g_free(mac_addr);
+ free(mac_addr);
return;
}
if (rv < 0)
ERR("Unable to execute system command");
- g_free(mac_addr);
+ free(mac_addr);
}
if (mac_addr != NULL) {
if (strlen(mac_addr) == 0)
netconfig_set_mac_address_from_file();
- g_free(mac_addr);
+ free(mac_addr);
}
}