changeset 29565:d39aa2e3a91f

Fix memleak when using fontconfig without a font name.
author reimar
date Tue, 01 Sep 2009 10:17:22 +0000
parents 4ae3d2d7946e
children b128ce47771d
files libvo/font_load_ft.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/font_load_ft.c	Tue Sep 01 09:36:04 2009 +0000
+++ b/libvo/font_load_ft.c	Tue Sep 01 10:17:22 2009 +0000
@@ -1157,10 +1157,8 @@
 #ifdef CONFIG_FONTCONFIG
     if (font_fontconfig > 0)
     {
-	if (!font_name)
-	    font_name = strdup("sans-serif");
 	FcInit();
-	fc_pattern = FcNameParse(font_name);
+	fc_pattern = FcNameParse(font_name ? font_name : "sans-serif");
 	FcConfigSubstitute(0, fc_pattern, FcMatchPattern);
 	FcDefaultSubstitute(fc_pattern);
 	fc_pattern2 = fc_pattern;