summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-04-23 13:16:13 +0200
committerbakkeby <[email protected]>2020-04-23 13:16:13 +0200
commit7c4a0c347fb06d6e4c3f96a819b2e94595cab5c9 (patch)
treefd47308b7cc9b0a7094ee4996bc5d0df0ac8aa20
parent1bed3b0093773974f435a23f7b280269b7092c1c (diff)
downloaddwm-flexipatch-7c4a0c347fb06d6e4c3f96a819b2e94595cab5c9.tar.gz
dwm-flexipatch-7c4a0c347fb06d6e4c3f96a819b2e94595cab5c9.zip
Adding if conditions before freeing res_class and res_name in applyrules
-rw-r--r--dwm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/dwm.c b/dwm.c
index 62321f7..5bae9f7 100644
--- a/dwm.c
+++ b/dwm.c
@@ -569,14 +569,16 @@ applyrules(Client *c)
#endif // SWITCHTAG_PATCH
}
}
- XFree(ch.res_class);
- XFree(ch.res_name);
+ if (ch.res_class)
+ XFree(ch.res_class);
+ if (ch.res_name)
+ XFree(ch.res_name);
#if EMPTYVIEW_PATCH
- if(c->tags & TAGMASK) c->tags = c->tags & TAGMASK;
+ if (c->tags & TAGMASK) c->tags = c->tags & TAGMASK;
#if SCRATCHPAD_PATCH
- else if(c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags] & ~SPTAGMASK;
+ else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags] & ~SPTAGMASK;
#else
- else if(c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags];
+ else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags];
#endif // SCRATCHPAD_PATCH
else c->tags = 1;
#elif SCRATCHPAD_PATCH