Fix OOM failure case in FcPStackPush.
When allocation for the node attributes fail, clean up the node allocation and report failure.
This commit is contained in:
parent
0f7870887a
commit
0aa5fbaa0d
|
@ -968,7 +968,12 @@ FcPStackPush (FcConfigParse *parse, FcElement element, const XML_Char **attr)
|
|||
{
|
||||
new->attr = FcConfigSaveAttr (attr);
|
||||
if (!new->attr)
|
||||
{
|
||||
FcConfigMessage (parse, FcSevereError, "out of memory");
|
||||
FcMemFree (FC_MEM_PSTACK, sizeof (FcPStack));
|
||||
free (new);
|
||||
return FcFalse;
|
||||
}
|
||||
}
|
||||
else
|
||||
new->attr = 0;
|
||||
|
|
Loading…
Reference in New Issue