This fixes a segmentation fault introduced by earlier changes.
Segmentation fault was used by accessing a queu that has been
destroyed, but the corresponding pointer hasn't been set to NULL.
Change-Id: I97d395e354ed8b21b9ec55d2eea924d7b1db9175
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
/* Unregister io callbacks */
if (node->net)
mesh_net_detach(node->net);
- mesh_net_free(node->net);
l_queue_destroy(node->elements, element_free);
- l_free(node->comp);
+ node->elements = NULL;
free_node_dbus_resources(node);
+
+ mesh_net_free(node->net);
+ l_free(node->comp);
l_free(node);
}