diff --git a/src/conky.c b/src/conky.c index 5f156924..6f7bde36 100644 --- a/src/conky.c +++ b/src/conky.c @@ -7416,7 +7416,6 @@ static void clean_up(void) XFlush(display); } - XFreeGC(display, window.gc); free_fonts(); } @@ -7650,6 +7649,8 @@ static void set_default_configurations(void) #endif /* X11 */ for (i = 0; i < MAX_TEMPLATES; i++) { + if (template[i]) + free(template[i]); template[i] = strdup(""); } @@ -8907,6 +8908,7 @@ int main(int argc, char **argv) g_signal_pending = 0; memset(&info, 0, sizeof(info)); + memset(template, 0, sizeof(template)); clear_net_stats(); #ifdef TCP_PORT_MONITOR diff --git a/src/x11.c b/src/x11.c index 5ee44460..6692694e 100644 --- a/src/x11.c +++ b/src/x11.c @@ -216,6 +216,7 @@ void set_transparent_background(Window win) void destroy_window(void) { XDestroyWindow(display, window.window); + XFreeGC(display, window.gc); memset(&window, 0, sizeof(struct conky_window)); }