XFree has always been an alias for free(), which does nothing when
passed NULL.  (This behavior is now officially documented in the xorg
man page for XFree.)
---
 dwm.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/dwm.c b/dwm.c
index 4465af1..dc77311 100644
--- a/dwm.c
+++ b/dwm.c
@@ -304,10 +304,8 @@ applyrules(Client *c)
                                c->mon = m;
                }
        }
-       if (ch.res_class)
-               XFree(ch.res_class);
-       if (ch.res_name)
-               XFree(ch.res_name);
+       XFree(ch.res_class);
+       XFree(ch.res_name);
        c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : 
c->mon->tagset[c->mon->seltags];
 }
 
@@ -1402,8 +1400,7 @@ scan(void)
                        && (wa.map_state == IsViewable || getstate(wins[i]) == 
IconicState))
                                manage(wins[i], &wa);
                }
-               if (wins)
-                       XFree(wins);
+               XFree(wins);
        }
 }
 
-- 
2.25.0


Reply via email to