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();