[hackers] [wmii] Fix freeing of the wrong view, which causes a crash and memory leak.

From: Kris Maglione <jg_AT_suckless.org>
Date: Wed Feb 14 19:44:27 2007

changeset: 1871:640887ab797a
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Wed Feb 14 13:39:37 2007 -0500
summary: Fix freeing of the wrong view, which causes a crash and memory leak.

diff -r 6fbb9c59c831 -r 640887ab797a view.c
--- a/view.c Tue Feb 13 14:58:18 2007 -0500
+++ b/view.c Wed Feb 14 13:39:37 2007 -0500
@@ -87,13 +87,13 @@ destroy_view(View *v) {
                 if(*i == v) break;
         *i = v->next;
         write_event("DestroyTag %s\n", v->name);
+ free(v);
         if(v == screen->sel) {
                 for(v=view; v && v->next; v=v->next)
                         if(v->next == *i) break;
                 if(v)
                         focus_view(screen, v);
         }
- free(v);
 }
 
 static void
Received on Wed Feb 14 2007 - 19:44:27 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:19 UTC