From: Cristy Date: Sat, 30 Sep 2017 15:12:31 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/816 X-Git-Tag: 7.0.7-5~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7519c777c85dff9d64d8328bbfadab6bd574ada5;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/816 --- diff --git a/MagickCore/draw.c b/MagickCore/draw.c index defd6b7e1..4d2746a33 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -6001,7 +6001,16 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, number_vertices+2UL,sizeof(*polygon_primitive)); if ((path_p == (PointInfo *) NULL) || (path_q == (PointInfo *) NULL) || (polygon_primitive == (PrimitiveInfo *) NULL)) - return((PrimitiveInfo *) NULL); + { + if (path_p != (PointInfo *) NULL) + path_p=(PointInfo *) RelinquishMagickMemory(path_p); + if (path_q != (PointInfo *) NULL) + path_q=(PointInfo *) RelinquishMagickMemory(path_q); + if (polygon_primitive != (PrimitiveInfo *) NULL) + polygon_primitive=(PrimitiveInfo *) RelinquishMagickMemory( + polygon_primitive); + return((PrimitiveInfo *) NULL); + } (void) CopyMagickMemory(polygon_primitive,primitive_info,(size_t) number_vertices*sizeof(*polygon_primitive)); closed_path=