Fix memleak when using fontconfig without a font name.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29607 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-09-01 10:17:22 +00:00
parent d7676e783e
commit b125a31886
1 changed files with 1 additions and 3 deletions

View File

@ -1157,10 +1157,8 @@ void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_n
#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;