Memleak: free the global inet-config on exit.
[citadel.git] / citadel / modules / inetcfg / serv_inetcfg.c
index 1e74c1df624173df4f4450c6597e6713301d1a76..3ac9339c2045d65573e411c741fe0053b6f3ea49 100644 (file)
@@ -185,7 +185,15 @@ void inetcfg_init(void) {
 /*****************************************************************************/
 /*                      MODULE INITIALIZATION STUFF                          */
 /*****************************************************************************/
+void clenaup_inetcfg(void)
+{
+       char *buf;
 
+       buf = inetcfg;
+       inetcfg = NULL;
+       if (buf != NULL)
+               free(buf);
+}
 
 CTDL_MODULE_INIT(inetcfg)
 {
@@ -193,6 +201,7 @@ CTDL_MODULE_INIT(inetcfg)
        {
                CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE);
                inetcfg_init();
+               CtdlRegisterCleanupHook(clenaup_inetcfg);
        }
        
        /* return our Subversion id for the Log */