From: oetiker Date: Wed, 1 Aug 2007 15:29:09 +0000 (+0000) Subject: only release cairo stuff if we ever initialized it. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b3ccf465726434d9c7ed313e7c2c8def99de6811;p=rrdtool-all.git only release cairo stuff if we ever initialized it. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1178 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index e295397e..d6568f35 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -308,7 +308,7 @@ int im_free( image_desc_t *im) { unsigned long i, ii; - cairo_status_t status; + cairo_status_t status = 0; if (im == NULL) return 0; @@ -329,10 +329,10 @@ int im_free( if (im->font_options) cairo_font_options_destroy(im->font_options); - status = cairo_status(im->cr); - - if (im->cr) + if (im->cr) { + status = cairo_status(im->cr); cairo_destroy(im->cr); + } if (im->surface) cairo_surface_destroy(im->surface); if (status)