diff options
-rw-r--r-- | libxslt/xsltutils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c index 39b1b9fd..59dd192d 100644 --- a/libxslt/xsltutils.c +++ b/libxslt/xsltutils.c @@ -1828,6 +1828,8 @@ xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len, (const xmlChar *) "UTF-8"))) encoder = NULL; buf = xmlAllocOutputBuffer(encoder); + if (buf == NULL) + xmlCharEncCloseFunc(encoder); } else { buf = xmlAllocOutputBuffer(NULL); } |