[Python-checkins] python/dist/src/Python compile.c,2.275,2.276
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Mon, 24 Mar 2003 09:22:29 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv5907/python/Python
Modified Files:
compile.c
Log Message:
symtable_cellvar_offsets(): This leaked references to little integers
in normal cases, and also in error cases.
Bugfix candidate.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.275
retrieving revision 2.276
diff -C2 -d -r2.275 -r2.276
*** compile.c 12 Feb 2003 16:56:51 -0000 2.275
--- compile.c 24 Mar 2003 17:22:24 -0000 2.276
***************
*** 4497,4501 ****
PyObject *varnames, int flags)
{
! PyObject *v, *w, *d, *list = NULL;
int i, pos;
--- 4497,4502 ----
PyObject *varnames, int flags)
{
! PyObject *v = NULL;
! PyObject *w, *d, *list = NULL;
int i, pos;
***************
*** 4531,4534 ****
--- 4532,4536 ----
if (PyDict_DelItem(*cellvars, PyList_GET_ITEM(list, i)) < 0)
goto fail;
+ Py_DECREF(v);
}
pos = 0;
***************
*** 4539,4542 ****
--- 4541,4545 ----
if (PyDict_SetItem(d, v, w) < 0) {
Py_DECREF(w);
+ v = NULL;
goto fail;
}
***************
*** 4548,4551 ****
--- 4551,4555 ----
fail:
Py_DECREF(d);
+ Py_XDECREF(v);
return -1;
}