aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-07-23 01:49:32 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-07-23 17:23:30 +0300
commit66a0d25337eb633476927da842dbec570ef03871 (patch)
tree97b40dc371adcfd060d9198340f384165fc594c0 /monsterwm.c
parentd0cc935242c1275870c94b84d3f7abd560ff6c36 (diff)
fix memory leak on killclient function
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 7fae1d7..e3c413e 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -641,11 +641,12 @@ void killclient(void) {
Desktop *d = &desktops[currdeskidx];
if (!d->curr) return;
- Atom *prot; int n = -1;
+ Atom *prot = NULL; int n = -1;
if (XGetWMProtocols(dis, d->curr->win, &prot, &n))
while(--n >= 0 && prot[n] != wmatoms[WM_DELETE_WINDOW]);
if (n < 0) { XKillClient(dis, d->curr->win); removeclient(d->curr, d); }
else deletewindow(d->curr->win);
+ if (prot) XFree(prot);
}
/**