Memleak: free the imap-handlerlist on exit
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 14 Nov 2010 22:09:32 +0000 (23:09 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 14 Nov 2010 22:09:32 +0000 (23:09 +0100)
citadel/modules/imap/serv_imap.c

index 959dec8826bbceda054a0669423cd65d49e80142..798c25e5fc1fd3047fa8a70c3acf9d39ec12bf32 100644 (file)
@@ -94,6 +94,11 @@ void registerImapCMD(const char *First, long FLen,
        }
 }
 
+void imap_cleanup(void)
+{
+       DeleteHash(&ImapCmds);
+}
+
 const imap_handler_hook *imap_lookup(int num_parms, ConstStr *Params)
 {
        void *v;
@@ -1710,6 +1715,7 @@ CTDL_MODULE_INIT(imap)
                                        NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS);
 #endif
                CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP);
+               CtdlRegisterCleanupHook(imap_cleanup);
        }
        
        /* return our Subversion id for the Log */