]> git.sesse.net Git - vlc/commitdiff
Freetype: fix double-free in error path
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 9 Oct 2011 22:00:14 +0000 (00:00 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 9 Oct 2011 22:00:14 +0000 (00:00 +0200)
modules/text_renderer/freetype.c

index 069e01d2f6cb627ab4677f4d5e1facf9f4401882..fe14eda38ad3a2964b72df33cbb215d31ba96246 100644 (file)
@@ -2594,9 +2594,6 @@ static int Create( vlc_object_t *p_this )
                  psz_fontfile ? psz_fontfile : "(null)" );
         goto error;
     }
-#ifdef HAVE_STYLES
-    free( psz_fontfile );
-#endif
 
     i_error = FT_Select_Charmap( p_sys->p_face, ft_encoding_unicode );
     if( i_error )
@@ -2627,6 +2624,10 @@ static int Create( vlc_object_t *p_this )
 
     LoadFontsFromAttachments( p_filter );
 
+#ifdef HAVE_STYLES
+    free( psz_fontfile );
+#endif
+
     return VLC_SUCCESS;
 
 error: