From 499a0c0c1b8f792d6069804aca4b5a94283149f3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 26 Sep 2017 20:57:46 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/782 --- MagickCore/annotate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index 03ab2b504..b2ab89b0e 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -1382,14 +1382,15 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, args.pathname=ConstantString(draw_info->font+1); face=(FT_Face) NULL; ft_status=FT_Open_Face(library,&args,(long) draw_info->face,&face); - args.pathname=DestroyString(args.pathname); if (ft_status != 0) { (void) FT_Done_FreeType(library); (void) ThrowMagickException(exception,GetMagickModule(),TypeError, - "UnableToReadFont","`%s'",draw_info->font); + "UnableToReadFont","`%s'",args.pathname); + args.pathname=DestroyString(args.pathname); return(MagickFalse); } + args.pathname=DestroyString(args.pathname); if ((draw_info->metrics != (char *) NULL) && (IsPathAccessible(draw_info->metrics) != MagickFalse)) (void) FT_Attach_File(face,draw_info->metrics); -- 2.40.0