Remove NameServer instance from module list in NameServer_delete() 3.40.00.03_eng
authorRobert Tivy <rtivy@ti.com>
Tue, 21 Jul 2015 23:56:43 +0000 (16:56 -0700)
committerRobert Tivy <rtivy@ti.com>
Fri, 24 Jul 2015 20:54:42 +0000 (13:54 -0700)
NameServer_delete() frees the memory for the NameServer instance
(NameServer_Handle), and if the instance is not removed from the
module objList then a subsequent NameServer_getHandle() call will
crash LAD due to a corrupt list (since one of the elements in the
list was free()d).

linux/src/daemon/NameServer_daemon.c

index 6ec0d8182deea1798559d9268b68259461cc54d1..279bf3604b4c20d0b7cfefe492cd6397f98a047c 100644 (file)
@@ -683,6 +683,9 @@ Int NameServer_delete(NameServer_Handle *handle)
     /* destroy the mutex */
     pthread_mutex_destroy(&obj->gate);
 
+    /* remove from objList */
+    CIRCLEQ_REMOVE(&NameServer_module->objList, obj, elem);
+
     /* finally, free the instance object */
     free(obj);