Fix possibly dereferencing a null pointer
This commit is contained in:
parent
8e97d745cc
commit
b1762935c3
|
@ -814,12 +814,15 @@ FcFontSetMatchInternal (FcFontSet **sets,
|
||||||
len = (p - s);
|
len = (p - s);
|
||||||
}
|
}
|
||||||
x = malloc (sizeof (char) * (len + 1));
|
x = malloc (sizeof (char) * (len + 1));
|
||||||
|
if (x)
|
||||||
|
{
|
||||||
strcpy (x, s);
|
strcpy (x, s);
|
||||||
if (FcObjectFromName (x) > 0)
|
if (FcObjectFromName (x) > 0)
|
||||||
FcObjectSetAdd (os, x);
|
FcObjectSetAdd (os, x);
|
||||||
s = p + 1;
|
s = p + 1;
|
||||||
free (x);
|
free (x);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
free (ss);
|
free (ss);
|
||||||
}
|
}
|
||||||
FcPatternPrint2 (p, best, os);
|
FcPatternPrint2 (p, best, os);
|
||||||
|
|
Loading…
Reference in New Issue