Because CAGetIPInterfaceInformation() allocates memory to
CAEndpoint_t at once, OICFree also should be called once.
Change-Id: I7cb85761e1d49e73d357928c77b364555d82c87f
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16621
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
{
OIC_LOG(DEBUG, TAG, "IP adapter status is off. Remove the own IP address info");
+ CAEndpoint_t *headEp = u_arraylist_get(g_ownIpEndpointList, 0);
+ OICFree(headEp);
+ headEp = NULL;
+
uint32_t len = u_arraylist_length(g_ownIpEndpointList);
for (uint32_t i = len; i > 0; i--)
{
- CAEndpoint_t *ep = u_arraylist_remove(g_ownIpEndpointList, i - 1);
- OICFree(ep);
+ u_arraylist_remove(g_ownIpEndpointList, i - 1);
}
}
}