aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-09-10 10:38:33 +0200
committermarha <marha@users.sourceforge.net>2013-09-10 10:42:30 +0200
commit2c1b75db27d66ff4760d624e44d1c1c6f42a4ca7 (patch)
treea32e3d5f8bb662ba5c14a72d97a553c4927c0b76 /fontconfig/src
parentd53900c52abc2402f978b72278712e4bcdbde9f2 (diff)
parent889d7dd8e94a5538f388cc619115bf5c0b6fc0b7 (diff)
downloadvcxsrv-2c1b75db27d66ff4760d624e44d1c1c6f42a4ca7.tar.gz
vcxsrv-2c1b75db27d66ff4760d624e44d1c1c6f42a4ca7.tar.bz2
vcxsrv-2c1b75db27d66ff4760d624e44d1c1c6f42a4ca7.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libX11 libXmu libxcb mesa xserver git update 10 Sep 2013 Conflicts: mesalib/src/glsl/.gitignore xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/winclipboardwndproc.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winsetsp.c
Diffstat (limited to 'fontconfig/src')
-rw-r--r--fontconfig/src/fcfreetype.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c
index 55f2626a5..056e0f6b5 100644
--- a/fontconfig/src/fcfreetype.c
+++ b/fontconfig/src/fcfreetype.c
@@ -1105,7 +1105,6 @@ FcFreeTypeQueryFace (const FT_Face face,
const char *tmp;
FcChar8 *hashstr = NULL;
- char *fontdata = NULL;
FT_Error err;
FT_ULong len = 0, alen;
@@ -1668,15 +1667,21 @@ FcFreeTypeQueryFace (const FT_Face face,
err = FT_Load_Sfnt_Table (face, 0, 0, NULL, &len);
if (err == FT_Err_Ok)
{
+ char *fontdata;
+
alen = (len + 63) & ~63;
fontdata = malloc (alen);
if (!fontdata)
goto bail3;
err = FT_Load_Sfnt_Table (face, 0, 0, (FT_Byte *)fontdata, &len);
if (err != FT_Err_Ok)
+ {
+ free (fontdata);
goto bail3;
+ }
memset (&fontdata[len], 0, alen - len);
hashstr = FcHashGetSHA256DigestFromMemory (fontdata, len);
+ free (fontdata);
}
else if (err == FT_Err_Invalid_Face_Handle)
{
@@ -1692,7 +1697,11 @@ FcFreeTypeQueryFace (const FT_Face face,
if (hashstr)
{
if (!FcPatternAddString (pat, FC_HASH, hashstr))
+ {
+ free (hashstr);
goto bail1;
+ }
+ free (hashstr);
}
bail3:
@@ -1783,10 +1792,6 @@ bail3:
bail2:
FcCharSetDestroy (cs);
bail1:
- if (hashstr)
- free (hashstr);
- if (fontdata)
- free (fontdata);
FcPatternDestroy (pat);
bail0:
return NULL;