From a02c06ff2433693845878db14878e5053af6ec02 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Sun, 27 Mar 2011 00:34:10 +0100
Subject: [PATCH] Freetype: fix regression

Caused by [231a967145083b2e31d615e2ecd2896e27595e4d]
Sorry for the disturbance
---
 modules/misc/text_renderer/freetype.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/misc/text_renderer/freetype.c b/modules/misc/text_renderer/freetype.c
index e85573427a5f..c0a91504ff40 100644
--- a/modules/misc/text_renderer/freetype.c
+++ b/modules/misc/text_renderer/freetype.c
@@ -347,6 +347,7 @@ static int Create( vlc_object_t *p_this )
         msg_Err( p_filter,"User didn't specify fontfile, using %s", psz_fontfamily);
 #endif
     }
+    p_sys->psz_fontfamily = psz_fontfamily;
 
     /* Set the font file */
 #ifdef HAVE_FONTCONFIG
@@ -356,11 +357,11 @@ static int Create( vlc_object_t *p_this )
     psz_fontfile = FontConfig_Select( NULL, psz_fontfamily, false, false,
                                       p_sys->i_default_font_size, &fontindex );
 
-    p_sys->psz_fontfamily = psz_fontfamily;
     msg_Dbg( p_filter, "Using %s as font from file %s", psz_fontfamily, psz_fontfile );
     if( !psz_fontfile )
-#else
         psz_fontfile = psz_fontfamily;
+#else
+    psz_fontfile = psz_fontfamily;
 #endif
 
     /* */
@@ -409,7 +410,6 @@ static int Create( vlc_object_t *p_this )
     p_filter->pf_render_html = NULL;
 #endif
 
-    free( psz_fontfamily );
     LoadFontsFromAttachments( p_filter );
 
     return VLC_SUCCESS;
@@ -444,8 +444,8 @@ static void Destroy( vlc_object_t *p_this )
 
 #ifdef HAVE_STYLES
     if( p_sys->p_xml ) xml_ReaderDelete( p_sys->p_xml );
-    free( p_sys->psz_fontfamily );
 #endif
+    free( p_sys->psz_fontfamily );
 
     /* FcFini asserts calling the subfunction FcCacheFini()
      * even if no other library functions have been made since FcInit(),
-- 
GitLab