Fix a crash when no sysroot is given and failed to load the default fonts.conf

This commit is contained in:
Akira TAGOH 2014-07-04 18:04:52 +09:00
parent f5b4b2c1ed
commit 5b22776999
1 changed files with 7 additions and 4 deletions

View File

@ -2342,7 +2342,7 @@ void
FcConfigSetSysRoot (FcConfig *config, FcConfigSetSysRoot (FcConfig *config,
const FcChar8 *sysroot) const FcChar8 *sysroot)
{ {
FcChar8 *s; FcChar8 *s = NULL;
FcBool init = FcFalse; FcBool init = FcFalse;
if (!config) if (!config)
@ -2362,9 +2362,12 @@ FcConfigSetSysRoot (FcConfig *config,
} }
} }
s = FcStrCopyFilename (sysroot); if (sysroot)
if (!s) {
return; s = FcStrCopyFilename (sysroot);
if (!s)
return;
}
if (config->sysRoot) if (config->sysRoot)
FcStrFree (config->sysRoot); FcStrFree (config->sysRoot);