From: Dana Jansens Date: Sun, 13 Apr 2003 02:28:29 +0000 (+0000) Subject: allow freeing NULL pixmap masks X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=2d9c03a44125c4fa51fd2e4b3054ee9395ff6150;p=chaz%2Fopenbox allow freeing NULL pixmap masks --- diff --git a/render/mask.c b/render/mask.c index 26059ca6..22cb3fee 100644 --- a/render/mask.c +++ b/render/mask.c @@ -14,9 +14,11 @@ pixmap_mask *pixmap_mask_new(int w, int h, char *data) void pixmap_mask_free(pixmap_mask *m) { - XFreePixmap(ob_display, m->mask); - g_free(m->data); - g_free(m); + if (m) { + XFreePixmap(ob_display, m->mask); + g_free(m->data); + g_free(m); + } } void mask_draw(Pixmap p, TextureMask *m, Rect *position)