Fix current_mail_spool memleak
authorNikolas Garofil <nikolas@garofil.be>
Thu, 18 Feb 2010 00:33:49 +0000 (01:33 +0100)
committerNikolas Garofil <nikolas@garofil.be>
Thu, 18 Feb 2010 00:33:49 +0000 (01:33 +0100)
src/conky.c
src/logging.h

index b9e1761..fbf9272 100644 (file)
@@ -3948,7 +3948,7 @@ static void main_loop(void)
 #endif /* HAVE_LUA */
                g_signal_pending = 0;
        }
-       clean_up(NULL, NULL);
+       clean_up(current_mail_spool, NULL);
 
 #ifdef HAVE_SYS_INOTIFY_H
        if (inotify_fd != -1) {
index dbc17ab..8bfa63f 100644 (file)
@@ -27,6 +27,8 @@
  *
  */
 
+#include "mail.h"
+
 void clean_up(void *memtofree1, void* memtofree2);
 
 #ifndef _LOGGING_H
@@ -40,7 +42,7 @@ void clean_up(void *memtofree1, void* memtofree2);
 
 /* critical error */
 #define CRIT_ERR(memtofree1, memtofree2, ...) \
-       { NORM_ERR(__VA_ARGS__); clean_up(memtofree1, memtofree2); exit(EXIT_FAILURE); }
+       { NORM_ERR(__VA_ARGS__); clean_up(memtofree1, memtofree2); free(current_mail_spool); exit(EXIT_FAILURE); }
 
 /* debugging output */
 extern int global_debug_level;