g_free(addr->address);
g_free(addr);
- addr = NULL;
+
FUNC_EXIT;
}
{
FUNC_ENTRY;
uam_db_tech_info_t *tech_info = data;
+ GSList *l;
ret_if(NULL == tech_info);
+ /* Delete the tech information from the service list that includes tech. */
+ for (l = tech_info->svc_list; NULL != l; l = g_slist_next(l)) {
+ uam_db_service_info_t *svc_info = l->data;
+
+ if (!svc_info || !svc_info->dev_techs)
+ continue;
+
+ svc_info->dev_techs = g_slist_remove(svc_info->dev_techs, tech_info);
+ }
+
g_slist_free_full(tech_info->addresses, __free_address_info);
+ tech_info->addresses = NULL;
+
+ if (tech_info->payload) {
+ if (tech_info->payload->duid) {
+ g_free(tech_info->payload->duid);
+ }
+ g_free(tech_info->payload);
+ }
+
g_free(tech_info);
- tech_info = NULL;
+
FUNC_EXIT;
}
g_free(device->device_id);
g_slist_free_full(device->tech_list, __free_dev_tech_info);
g_free(device);
- device = NULL;
+
FUNC_EXIT;
}
for (l = device->tech_list; NULL != l; l = g_slist_next(l)) {
uam_db_tech_info_t *tech = l->data;
- GSList *l1;
+ GSList *l1, *l2;
int ret;
if (!tech)
continue;
+ /* Delete the tech information from the service list that includes tech. */
+ for (l2 = tech->svc_list; NULL != l2; l2 = g_slist_next(l2)) {
+ uam_db_service_info_t *svc_info = l2->data;
+
+ if (!svc_info || !svc_info->dev_techs)
+ continue;
+
+ svc_info->dev_techs = g_slist_remove(svc_info->dev_techs, tech);
+ }
+
dev_info.type = tech->tech_type;
memset(dev_info.mac, 0x00, UAM_MAC_ADDRESS_STRING_LEN);
memset(dev_info.ipv4_addr, 0x00, UAM_IP_ADDRESS_MAX_STRING_LEN);