Fix memleaks in CRIT_ERR
authorNikolas Garofil <garo@dunaldi.garofil.be>
Wed, 8 Jul 2009 13:51:08 +0000 (15:51 +0200)
committerNikolas Garofil <garo@dunaldi.garofil.be>
Wed, 8 Jul 2009 13:51:08 +0000 (15:51 +0200)
src/conky.c
src/logging.h

index a24e692..5c54b40 100644 (file)
@@ -153,7 +153,6 @@ void *global_cpu = NULL;
 static void signal_handler(int);
 static void print_version(void) __attribute__((noreturn));
 static void reload_config(void);
-static void clean_up(void);
 static void generate_text_internal(char *, int, struct text_object,
                                    struct information *);
 static int extract_variable_text_internal(struct text_object *,
@@ -7527,7 +7526,7 @@ static void reload_config(void)
        }
 }
 
-static void clean_up(void)
+void clean_up(void)
 {
        int i;
        timed_thread_destroy_registered_threads();
index b09e616..0f5bb42 100644 (file)
@@ -24,6 +24,9 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
+
+void clean_up(void);
+
 #ifndef _LOGGING_H
 #define _LOGGING_H
 
@@ -35,7 +38,7 @@
 
 /* critical error */
 #define CRIT_ERR(...) \
-       { ERR(__VA_ARGS__); exit(EXIT_FAILURE); }
+       { ERR(__VA_ARGS__); clean_up(); exit(EXIT_FAILURE); }
 
 /* debugging output */
 extern int global_debug_level;