diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2007-01-09 21:24:34 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2007-01-09 21:24:34 +0000 |
commit | a3d230513c3f28dc475ee09ffd6787762da07d56 (patch) | |
tree | de6fcb8d0fb9323b30f152e431682cba21d67353 | |
parent | e96b47fd3dabf9b5e88c72db34e777dd36802eab (diff) | |
download | android_external_libxml2-a3d230513c3f28dc475ee09ffd6787762da07d56.tar.gz android_external_libxml2-a3d230513c3f28dc475ee09ffd6787762da07d56.tar.bz2 android_external_libxml2-a3d230513c3f28dc475ee09ffd6787762da07d56.zip |
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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | python/libxml.c | 3 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Tue Jan 9 22:24:26 CET 2007 Daniel Veillard <daniel@veillard.com> + + * python/libxml.c: fix a memory leak in the python string handling + when SAX event are passed back to the python handlers + Thu Jan 4 18:27:49 CET 2007 Daniel Veillard <daniel@veillard.com> * xmlreader.c: fix xmlTextReaderSetup() description diff --git a/python/libxml.c b/python/libxml.c index 6e9a78ee..747e44cf 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -773,6 +773,8 @@ pythonStartElement(void *user_data, const xmlChar * name, attrvalue = Py_None; } PyDict_SetItem(dict, attrname, attrvalue); + Py_DECREF(attrname); + Py_DECREF(attrvalue); } } @@ -1170,6 +1172,7 @@ pythonAttributeDecl(void *user_data, for (node = tree; node != NULL; node = node->next) { newName = PyString_FromString((char *) node->name); PyList_SetItem(nameList, count, newName); + Py_DECREF(newName); count++; } result = PyObject_CallMethod(handler, (char *) "attributeDecl", |