Commit dda27aa9 authored by Keith Packard's avatar Keith Packard

Avoid crash when $HOME is not set

parent 48092073
......@@ -428,9 +428,10 @@ FcStrCopyFilename (const FcChar8 *s)
if (*s == '~')
{
FcChar8 *home = (FcChar8 *) getenv ("HOME");
int size = strlen ((char *) home) + strlen ((char *) s);
int size;
if (!home)
return 0;
size = strlen ((char *) home) + strlen ((char *) s);
new = (FcChar8 *) malloc (size);
if (!new)
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment