Commit b1762935 authored by Akira TAGOH's avatar Akira TAGOH

Fix possibly dereferencing a null pointer

parent 8e97d745
......@@ -814,11 +814,14 @@ FcFontSetMatchInternal (FcFontSet **sets,
len = (p - s);
}
x = malloc (sizeof (char) * (len + 1));
strcpy (x, s);
if (FcObjectFromName (x) > 0)
FcObjectSetAdd (os, x);
s = p + 1;
free (x);
if (x)
{
strcpy (x, s);
if (FcObjectFromName (x) > 0)
FcObjectSetAdd (os, x);
s = p + 1;
free (x);
}
}
free (ss);
}
......
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