Skip to content

Commit a3d2305

Browse files
author
Daniel Veillard
committed
fix a memory leak in the python string handling when SAX event are passed
* python/libxml.c: fix a memory leak in the python string handling when SAX event are passed back to the python handlers Daniel svn path=/trunk/; revision=3573
1 parent e96b47f commit a3d2305

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Tue Jan 9 22:24:26 CET 2007 Daniel Veillard <daniel@veillard.com>
2+
3+
* python/libxml.c: fix a memory leak in the python string handling
4+
when SAX event are passed back to the python handlers
5+
16
Thu Jan 4 18:27:49 CET 2007 Daniel Veillard <daniel@veillard.com>
27

38
* xmlreader.c: fix xmlTextReaderSetup() description

python/libxml.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ pythonStartElement(void *user_data, const xmlChar * name,
773773
attrvalue = Py_None;
774774
}
775775
PyDict_SetItem(dict, attrname, attrvalue);
776+
Py_DECREF(attrname);
777+
Py_DECREF(attrvalue);
776778
}
777779
}
778780

@@ -1170,6 +1172,7 @@ pythonAttributeDecl(void *user_data,
11701172
for (node = tree; node != NULL; node = node->next) {
11711173
newName = PyString_FromString((char *) node->name);
11721174
PyList_SetItem(nameList, count, newName);
1175+
Py_DECREF(newName);
11731176
count++;
11741177
}
11751178
result = PyObject_CallMethod(handler, (char *) "attributeDecl",

0 commit comments

Comments
 (0)