From a3d230513c3f28dc475ee09ffd6787762da07d56 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 9 Jan 2007 21:24:34 +0000 Subject: 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 --- python/libxml.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python/libxml.c') 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", -- cgit v1.2.1