From f4fd1648e9fc84b8c301782ed39d88d92a40bb96 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 12 Jul 2009 00:05:53 +0200 Subject: [PATCH] Fix: reading mem after its freed (current_config) --- src/conky.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conky.c b/src/conky.c index 3ffb55df..726a3f07 100644 --- a/src/conky.c +++ b/src/conky.c @@ -7374,12 +7374,12 @@ static void main_loop(void) break; } #ifdef HAVE_SYS_INOTIFY_H - if (inotify_fd != -1 && inotify_config_wd == -1) { + if (inotify_fd != -1 && inotify_config_wd == -1 && current_config != 0) { inotify_config_wd = inotify_add_watch(inotify_fd, current_config, IN_MODIFY); } - if (inotify_fd != -1 && inotify_config_wd != -1) { + if (inotify_fd != -1 && inotify_config_wd != -1 && current_config != 0) { int len = 0, idx = 0; fd_set descriptors; struct timeval time_to_wait; @@ -7569,6 +7569,7 @@ void clean_up(void) } free(current_config); + current_config = 0; #ifdef TCP_PORT_MONITOR tcp_portmon_clear();