From: Dana Jansens Date: Sun, 13 Apr 2003 02:26:56 +0000 (+0000) Subject: dont fux self in color_free if the color is NULL X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=c2bb32dcd1539796f0c8da49d3df3468553ad256;p=chaz%2Fopenbox dont fux self in color_free if the color is NULL --- diff --git a/render/color.c b/render/color.c index c2570720..939098ea 100644 --- a/render/color.c +++ b/render/color.c @@ -58,9 +58,11 @@ color_rgb *color_new(int r, int g, int b) void color_free(color_rgb *c) { - if (c->gc != None) - XFreeGC(ob_display, c->gc); - g_free(c); + if (c != NULL) { + if (c->gc != None) + XFreeGC(ob_display, c->gc); + g_free(c); + } } void reduce_depth(pixel32 *data, XImage *im) @@ -87,7 +89,7 @@ void reduce_depth(pixel32 *data, XImage *im) data += im->width; p32 += im->width; } - } else im->data = data; + } else im->data = (char*) data; break; case 16: for (y = 0; y < im->height; y++) {