From: Ravi Nanjundappa Date: Wed, 5 Oct 2016 09:46:10 +0000 (+0530) Subject: Fix for VDSvace issue: DF160920-00051 X-Git-Tag: submit/tizen/20161010.113913~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9bc3e5ab934f3aab30a8dcde41494d8021be766c;p=platform%2Fcore%2Fgraphics%2Fcairo.git Fix for VDSvace issue: DF160920-00051 Assigned the group handle to NULL after free inside _cairo_pdf_smask_group_destroy() and then checking against NULL value before freeing its members further. Change-Id: Icf9eacf075478244fb09dc6e2678b8d12cd7e292 Signed-off-by: Ravi Nanjundappa --- diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 552e4bf4f..db5006294 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -1101,18 +1101,22 @@ _cairo_pdf_surface_create_smask_group (cairo_pdf_surface_t *surface, static void _cairo_pdf_smask_group_destroy (cairo_pdf_smask_group_t *group) { + if(group != NULL) + { if (group->operation == PDF_FILL || group->operation == PDF_STROKE) - _cairo_path_fixed_fini (&group->path); + _cairo_path_fixed_fini (&group->path); if (group->source) - cairo_pattern_destroy (group->source); + cairo_pattern_destroy (group->source); if (group->mask) - cairo_pattern_destroy (group->mask); + cairo_pattern_destroy (group->mask); free (group->utf8); free (group->glyphs); free (group->clusters); if (group->scaled_font) - cairo_scaled_font_destroy (group->scaled_font); + cairo_scaled_font_destroy (group->scaled_font); free (group); + group = NULL; + } } static cairo_int_status_t