PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.

This commit is contained in:
Tim Peters 2006-05-17 01:30:11 +00:00
parent 1b38357094
commit 402cc242f0
1 changed files with 9 additions and 5 deletions

View File

@ -685,10 +685,12 @@ PyZlib_copy(compobject *self)
goto error;
}
Py_INCREF(self->unused_data);
Py_INCREF(self->unconsumed_tail);
Py_XDECREF(retval->unused_data);
Py_XDECREF(retval->unconsumed_tail);
retval->unused_data = self->unused_data;
retval->unconsumed_tail = self->unconsumed_tail;
Py_INCREF(retval->unused_data);
Py_INCREF(retval->unconsumed_tail);
/* Mark it as being initialized */
retval->is_initialised = 1;
@ -734,10 +736,12 @@ PyZlib_uncopy(compobject *self)
goto error;
}
Py_INCREF(self->unused_data);
Py_INCREF(self->unconsumed_tail);
Py_XDECREF(retval->unused_data);
Py_XDECREF(retval->unconsumed_tail);
retval->unused_data = self->unused_data;
retval->unconsumed_tail = self->unconsumed_tail;
Py_INCREF(retval->unused_data);
Py_INCREF(retval->unconsumed_tail);
/* Mark it as being initialized */
retval->is_initialised = 1;