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.verplant.org/?a=commitdiff_plain;h=a39d10a2244a55d5af2d1c4b10f318fed3397cd4;p=rrdtool.git only release cairo stuff if we ever initialized it. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1178 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index e295397..d6568f3 100644 --- a/src/rrd_graph.c +++ b/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)