From 4b9c4e42014759e4f6ebb6e588a9f1113a256d61 Mon Sep 17 00:00:00 2001 From: Haoyang Chen Date: Thu, 13 May 2021 14:17:57 +0800 Subject: [PATCH] gdi32: Fix a memory leak. Signed-off-by: Haoyang Chen Signed-off-by: Alexandre Julliard --- dlls/gdi32/freetype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 456eb245700..6af76d6f81b 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1540,9 +1540,10 @@ static UINT parse_aa_pattern( FcPattern *pattern ) static FcPattern *create_family_pattern( const char *name, FcPattern **cached ) { - FcPattern *ret = NULL, *tmp, *pattern = pFcPatternCreate(); + FcPattern *ret = NULL, *tmp, *pattern; FcResult result; if (*cached) return *cached; + pattern = pFcPatternCreate(); pFcPatternAddString( pattern, FC_FAMILY, (const FcChar8 *)name ); pFcPatternAddString( pattern, FC_NAMELANG, (const FcChar8 *)"en-us" ); pFcPatternAddString( pattern, FC_PRGNAME, (const FcChar8 *)"wine" );