]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed null pointer access
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Jan 2019 01:57:06 +0000 (20:57 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Jan 2019 01:57:06 +0000 (20:57 -0500)
src/registrar.c

index d956382512bc9dda03ff4407f864b5d661970702..1a37109086fe3b7e8d47b656f582c843dc3e8fc5 100644 (file)
@@ -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) {