Memleak: fix the varous handler & config lists of the rss module on exit.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 14 Nov 2010 22:10:10 +0000 (23:10 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 14 Nov 2010 22:10:10 +0000 (23:10 +0100)
citadel/modules/rssclient/serv_rssclient.c

index 33e333513fbe8c77c732b98454705e846d113b2d..13156ba0df047eca2b55796bc577d30c4e166738 100644 (file)
@@ -1539,6 +1539,14 @@ void LoadUrlShorteners(void)
        close(fd);
 }
 
+void rss_cleanup(void)
+{
+        DeleteHash(&StartHandlers);
+        DeleteHash(&EndHandlers);
+       DeleteHash(&UrlShorteners);
+       DeleteHash(&KnownNameSpaces);
+}
+
 CTDL_MODULE_INIT(rssclient)
 {
        if (threading)
@@ -1632,6 +1640,7 @@ CTDL_MODULE_INIT(rssclient)
                /* we don't like these namespaces because of they shadow our usefull parameters. */
                Put(KnownNameSpaces, HKEY("http://search.yahoo.com/mrss/"), NULL, reference_free_handler);
 #endif
+                CtdlRegisterCleanupHook(rss_cleanup);
        }
        return "rssclient";
 }