From efb39867c7a65a4a2cb20a9907a3919c41a0cfb2 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Tue, 16 Feb 2010 19:20:48 +0100 Subject: [PATCH] Fix 3 memleaks in ncurses-related code --- src/conky.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/conky.cc b/src/conky.cc index ae0a00a6..17780e12 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -161,6 +161,10 @@ int ifup_strictness = IFUP_UP; extern kvm_t *kd; #endif +#ifdef BUILD_NCURSES +WINDOW* ncurses_screen; +#endif + int argc_copy; char** argv_copy; @@ -2379,6 +2383,7 @@ void clean_up(void *memtofree1, void* memtofree2) #ifdef BUILD_NCURSES if(output_methods & TO_NCURSES) { endwin(); + delwin(ncurses_screen); } #endif conftree_empty(currentconffile); @@ -3209,7 +3214,7 @@ char load_config_file(const char *f) #ifdef BUILD_NCURSES CONF("out_to_ncurses") { if(string_to_bool(value)) { - initscr(); + ncurses_screen = initscr(); start_color(); output_methods |= TO_NCURSES; }