From: Andy Spencer Date: Thu, 6 Oct 2011 07:17:45 +0000 (+0000) Subject: Fix memory management bugs X-Git-Url: http://pileus.org/git/?p=wmpus;a=commitdiff_plain;h=81df0eb31af414e4712fb8c81d0bdc4fd4cbb641 Fix memory management bugs --- diff --git a/wm-wmii.c b/wm-wmii.c index aab2921..6618adb 100644 --- a/wm-wmii.c +++ b/wm-wmii.c @@ -588,15 +588,14 @@ static void tag_switch(int name) printf("tag_switch: %d\n", name); tag_t *old = wm_tag; if ((wm_col == NULL || wm_row == NULL) && wm_flt == NULL) { - list_t *ltag = list_find(wm->tags, old); - wm->tags = list_remove(wm->tags, ltag, 1); while (old->dpys) { dpy_t *dpy = old->dpys->data; while (dpy->cols) dpy->cols = list_remove(dpy->cols, dpy->cols, 1); old->dpys = list_remove(old->dpys, old->dpys, 1); } - free(old); + list_t *ltag = list_find(wm->tags, old); + wm->tags = list_remove(wm->tags, ltag, 1); } wm_tag = tag_find(name); }