Kaydet (Commit) 0149e3a0 authored tarafından Fredrik Lundh's avatar Fredrik Lundh

Fixed None reference leaks in TreeBuilder class (reported by Neal

Norwitz)
üst 7c460740
......@@ -1501,10 +1501,12 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
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 @@ treebuilder_handle_end(TreeBuilderObject* self, PyObject* tag)
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)
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment