From: Keith Packard Date: Sun, 23 Dec 2007 22:06:41 +0000 (-0800) Subject: Fix OOM failure case in FcPStackPush. X-Git-Tag: 2.5.91~10 X-Git-Url: https://git.wh0rd.org/?p=fontconfig.git;a=commitdiff_plain;h=0aa5fbaa0df9d6c7bee8e0839dd443de9c48a402 Fix OOM failure case in FcPStackPush. When allocation for the node attributes fail, clean up the node allocation and report failure. --- diff --git a/src/fcxml.c b/src/fcxml.c index cec9f6f..1910306 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -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;