[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.61,2.62
Barry Warsaw
bwarsaw@users.sourceforge.net
Thu, 16 Aug 2001 13:33:50 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv12026
Modified Files:
_sre.c
Log Message:
init_sre(): Plug a little leak reported by Insure.
Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.61
retrieving revision 2.62
diff -C2 -d -r2.61 -r2.62
*** _sre.c 2001/07/08 13:26:57 2.61
--- _sre.c 2001/08/16 20:33:48 2.62
***************
*** 2617,2620 ****
--- 2617,2621 ----
PyObject* m;
PyObject* d;
+ PyObject* x;
/* Patch object types */
***************
*** 2626,2635 ****
PyDict_SetItemString(
! d, "MAGIC", (PyObject*) PyInt_FromLong(SRE_MAGIC)
);
PyDict_SetItemString(
! d, "copyright", (PyObject*) PyString_FromString(copyright)
);
}
--- 2627,2638 ----
PyDict_SetItemString(
! d, "MAGIC", (x = (PyObject*) PyInt_FromLong(SRE_MAGIC))
);
+ Py_XDECREF(x);
PyDict_SetItemString(
! d, "copyright", (x = (PyObject*)PyString_FromString(copyright))
);
+ Py_XDECREF(x);
}