1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

Added memory debug wrappers, killed all detected memory leaks, Daniel

This commit is contained in:
Daniel Veillard
1999-09-02 22:04:43 +00:00
parent 1ff7ae3dfd
commit 6454aec23d
20 changed files with 991 additions and 378 deletions

View File

@ -12,6 +12,7 @@
#include <stdlib.h>
#include <string.h> /* for memset() only ! */
#include "xmlmemory.h"
#include "HTMLparser.h"
#include "HTMLtree.h"
#include "entities.h"
@ -70,7 +71,7 @@ htmlAttrDump(xmlBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur) {
if (value) {
xmlBufferWriteChar(buf, "=");
xmlBufferWriteQuotedString(buf, value);
free(value);
xmlFree(value);
} else {
xmlBufferWriteChar(buf, "=\"\"");
}
@ -146,7 +147,7 @@ htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
if (buffer != NULL) {
xmlBufferWriteCHAR(buf, buffer);
free(buffer);
xmlFree(buffer);
}
}
return;
@ -207,7 +208,7 @@ htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
if (buffer != NULL) {
xmlBufferWriteCHAR(buf, buffer);
free(buffer);
xmlFree(buffer);
}
}
if (cur->childs != NULL) {
@ -277,7 +278,7 @@ htmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int *size) {
*mem = buf->content;
*size = buf->use;
memset(buf, -1, sizeof(xmlBuffer));
free(buf);
xmlFree(buf);
}