A couple of clean up functions to help valgrind.
[citadel.git] / citadel / serv_extensions.c
index be0e74815858dd98404d2a9aa479bf98c57b91db..026af0680ac64500d8dbf896513c9369aef9e88c 100644 (file)
@@ -1156,6 +1156,21 @@ int CtdlDoDirectoryServiceFunc(char *cn, char *ou, void **object, char *module,
        return 0;
 }
 
+void CtdlDestroyDirectoryServiceFuncs(void)
+{
+       struct DirectoryServiceHook *cur, *next;
+       
+       cur = DirectoryServiceHookList;
+       DirectoryServiceHookList = NULL;
+       while (cur)
+       {
+               next = cur->next;
+               CtdlLogPrintf(CTDL_INFO, "Destroyed directory service function for module %s.\n", cur->module);
+               free(cur);
+               cur = next;
+       }
+}
+
 /*
  * Dirty hack until we impliment a hook mechanism for this
  */