aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2014-02-02 16:13:50 +0000
committerokan2014-02-02 16:13:50 +0000
commit7cf90fa84564259d6ef67cd63017a6cdec385f5a (patch)
tree4a09fefbbb0c5ecb4054116822b81925a4e209a2
parentf66dedc8c6a186274d1dbc6220671401eba44b62 (diff)
downloadcwm-7cf90fa84564259d6ef67cd63017a6cdec385f5a.tar.gz
Unlike free(3), XFree(3) can't be passed a NULL pointer.
-rw-r--r--screen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/screen.c b/screen.c
index ce65e3b..26249d3 100644
--- a/screen.c
+++ b/screen.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: screen.c,v 1.55 2014/01/27 15:13:09 okan Exp $
+ * $OpenBSD: screen.c,v 1.56 2014/02/02 16:13:50 okan Exp $
*/
#include <sys/param.h>
@@ -65,7 +65,6 @@ screen_init(int which)
/* Deal with existing clients. */
XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins);
-
for (i = 0; i < nwins; i++) {
XGetWindowAttributes(X_Dpy, wins[i], &winattr);
if (winattr.override_redirect ||
@@ -73,7 +72,8 @@ screen_init(int which)
continue;
(void)client_init(wins[i], sc, winattr.map_state != IsUnmapped);
}
- XFree(wins);
+ if (wins)
+ XFree(wins);
screen_updatestackingorder(sc);