From e4b81748b199f6a388a50315aa0bf87cad6b5352 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 16 Jan 2019 20:57:06 -0500 Subject: [PATCH] fixed null pointer access --- src/registrar.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/registrar.c b/src/registrar.c index d956382..1a37109 100644 --- a/src/registrar.c +++ b/src/registrar.c @@ -147,19 +147,19 @@ void propnotify(XConf* x, XEvent* e) { if(file) XFree(file); if(addr) XFree(addr); } -// /* cleanup any invalid windows */ -// TWindow* wins = Windows; -// Windows = NULL; -// while (wins) { -// TWindow* curr = wins; -// wins = curr->next; -// if (!wins->path) { -// free(curr); -// } else { -// curr->next = Windows; -// Windows = curr; -// } -// } + /* cleanup any invalid windows */ + TWindow* wins = Windows; + Windows = NULL; + while (wins && wins->next) { + TWindow* curr = wins; + wins = curr->next; + if (!wins->path) { + free(curr); + } else { + curr->next = Windows; + Windows = curr; + } + } } void find_windows(XConf* x) { -- 2.49.0