Don't crash if config is null (Coverity defect #984).

This commit is contained in:
Patrick Lam 2006-04-12 02:38:28 +00:00
parent 2de24638b2
commit 5c90509c07
2 changed files with 12 additions and 6 deletions

View File

@ -1,18 +1,23 @@
2006-04-11 Patrick Lam <plam@mit.edu>
* src/fccache.c (FcGlobalCacheReadDir):
Don't crash if config is null (Coverity defect #984).
2006-04-11 Frederic Crozat <fcrozat@mandriva.com>
reviewed by: plam
* src/fccharset.c: (FcCharSetPutLeaf):
* src/fclang.c: (FcNameUnparseLangSet):
* src/fccharset.c (FcCharSetPutLeaf):
* src/fclang.c (FcNameUnparseLangSet):
Missing bits from previous patches.
* src/fccharset.c (FcCharSetSubtractCount):
Remove extra semi-colon.
* src/fccfg.c: (FcConfigBuildFonts):
* src/fccfg.c (FcConfigBuildFonts):
Fix memory leak in error case (Coverity defects #776, #985).
* src/fcxml.c: (FcPopBinary, FcParsePatelt, FcParsePattern):
* src/fcxml.c (FcPopBinary, FcParsePatelt, FcParsePattern):
Fix memory leaks (Coverity defects #779, #781)
and memory use after free (Coverity defect #780).

View File

@ -320,8 +320,9 @@ FcGlobalCacheReadDir (FcFontSet *set, FcStrSet *dirs, FcGlobalCache * cache, con
if (cache->fd == -1)
return FcFalse;
if (!(dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir)))
return FcFalse; /* non-existing directory */
if (config)
if (!(dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir)))
return FcFalse; /* non-existing directory */
for (d = cache->dirs; d; d = d->next)
{