]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/inetcfg/serv_inetcfg.c
Memleak: free the global inet-config on exit.
[citadel.git] / citadel / modules / inetcfg / serv_inetcfg.c
index 051aae3bcb024e3619daa6bdb0a2e164d0b142ce..3ac9339c2045d65573e411c741fe0053b6f3ea49 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$ 
- *
  * This module handles the loading/saving and maintenance of the
  * system's Internet configuration.  It's not an optional component; I
  * wrote it as a module merely to keep things as clean and loosely coupled
@@ -187,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)
 {
@@ -195,9 +201,10 @@ CTDL_MODULE_INIT(inetcfg)
        {
                CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE);
                inetcfg_init();
+               CtdlRegisterCleanupHook(clenaup_inetcfg);
        }
        
        /* return our Subversion id for the Log */
-       return "$Id$";
+       return "inetcfg";
 }