[Python-checkins] commit of r41759 - python/trunk/Modules/_elementtree.c
fredrik.lundh
python-checkins at python.org
Sun Dec 18 14:58:26 CET 2005
Author: fredrik.lundh
Date: Sun Dec 18 14:58:25 2005
New Revision: 41759
Modified:
python/trunk/Modules/_elementtree.c
Log:
fixed None reference leaks in treebuilder class (reported by Neal
Norwich)
Modified: python/trunk/Modules/_elementtree.c
==============================================================================
--- python/trunk/Modules/_elementtree.c (original)
+++ python/trunk/Modules/_elementtree.c Sun Dec 18 14:58:25 2005
@@ -1501,10 +1501,12 @@
if (self->data) {
if (self->this == self->last) {
+ Py_DECREF(self->last->text);
self->last->text = JOIN_SET(
self->data, PyList_CheckExact(self->data)
);
} else {
+ Py_DECREF(self->last->tail);
self->last->tail = JOIN_SET(
self->data, PyList_CheckExact(self->data)
);
@@ -1606,10 +1608,12 @@
if (self->data) {
if (self->this == self->last) {
+ Py_DECREF(self->last->text);
self->last->text = JOIN_SET(
self->data, PyList_CheckExact(self->data)
);
} else {
+ Py_DECREF(self->last->tail);
self->last->tail = JOIN_SET(
self->data, PyList_CheckExact(self->data)
);
More information about the Python-checkins
mailing list