1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

fix memory leak in xmlAllocOutputBuffer

This commit is contained in:
zhouzhongyuan 2019-07-09 15:11:01 +08:00 committed by Nick Wellnhofer
parent 1fc410d3d3
commit 4f67dbb0a1

1
xmlIO.c Normal file → Executable file
View File

@ -2383,6 +2383,7 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) {
if (encoder != NULL) { if (encoder != NULL) {
ret->conv = xmlBufCreateSize(4000); ret->conv = xmlBufCreateSize(4000);
if (ret->conv == NULL) { if (ret->conv == NULL) {
xmlBufFree(ret->buffer);
xmlFree(ret); xmlFree(ret);
return(NULL); return(NULL);
} }