From 20fca2bb3de6f2bbfc8ec2c8077b14d6c948092c Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 9 Apr 2024 15:39:06 +0200 Subject: [PATCH] save: Report malloc failure in xmlAttrSerializeTxtContent Flush buffer before checking for errors. --- xmlsave.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xmlsave.c b/xmlsave.c index 42e23f1b..13b2ed3c 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -2407,6 +2407,7 @@ xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr doc, return; out = xmlOutputBufferCreateBuffer(buf, NULL); xmlBufAttrSerializeTxtContent(out, doc, string); + xmlOutputBufferFlush(out); if ((out == NULL) || (out->error)) xmlFree(xmlBufferDetach(buf)); xmlOutputBufferClose(out);