mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-10 08:58:16 +03:00
remove a couple of leaks on errors reported by Jinmei Tatuya daniel
* xmlwriter.c: remove a couple of leaks on errors reported by Jinmei Tatuya daniel svn path=/trunk/; revision=3816
This commit is contained in:
parent
97ff9b367a
commit
eb0a0b2e31
@ -1,3 +1,8 @@
|
||||
Fri Feb 20 09:18:56 CET 2009 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xmlwriter.c: remove a couple of leaks on errors reported by
|
||||
Jinmei Tatuya
|
||||
|
||||
Sun Jan 18 22:37:59 CET 2009 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* configure.in doc/xml.html doc/*: preparing 0.7.3 release
|
||||
|
13
xmlwriter.c
13
xmlwriter.c
@ -370,7 +370,7 @@ xmlNewTextWriterDoc(xmlDocPtr * doc, int compression)
|
||||
ctxt = xmlCreatePushParserCtxt(&saxHandler, NULL, NULL, 0, NULL);
|
||||
if (ctxt == NULL) {
|
||||
xmlWriterErrMsg(NULL, XML_ERR_INTERNAL_ERROR,
|
||||
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
|
||||
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
@ -389,8 +389,10 @@ xmlNewTextWriterDoc(xmlDocPtr * doc, int compression)
|
||||
|
||||
ret = xmlNewTextWriterPushParser(ctxt, compression);
|
||||
if (ret == NULL) {
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
xmlWriterErrMsg(NULL, XML_ERR_INTERNAL_ERROR,
|
||||
"xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n");
|
||||
"xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1510,12 +1512,13 @@ xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content)
|
||||
|
||||
if (buf != NULL) {
|
||||
count = xmlTextWriterWriteRaw(writer, buf);
|
||||
if (count < 0)
|
||||
return -1;
|
||||
sum += count;
|
||||
|
||||
if (buf != content) /* buf was allocated by us, so free it */
|
||||
xmlFree(buf);
|
||||
|
||||
if (count < 0)
|
||||
return -1;
|
||||
sum += count;
|
||||
}
|
||||
|
||||
return sum;
|
||||
|
Loading…
x
Reference in New Issue
Block a user