summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-08-16 20:33:48 (GMT)
committerBarry Warsaw <barry@python.org>2001-08-16 20:33:48 (GMT)
commit214a0b138291a649b90f86ae7d3b2a788016947d (patch)
tree8a12a0a0708fbe40cbe68f578bd11604414555a7 /Modules
parent5aa3c4af76a1ed08cf275bb049cfa3ebe9758386 (diff)
downloadcpython-214a0b138291a649b90f86ae7d3b2a788016947d.zip
cpython-214a0b138291a649b90f86ae7d3b2a788016947d.tar.gz
cpython-214a0b138291a649b90f86ae7d3b2a788016947d.tar.bz2
init_sre(): Plug a little leak reported by Insure.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sre.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index caf47aa..1776a16 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -2616,6 +2616,7 @@ init_sre(void)
{
PyObject* m;
PyObject* d;
+ PyObject* x;
/* Patch object types */
Pattern_Type.ob_type = Match_Type.ob_type =
@@ -2625,12 +2626,14 @@ init_sre(void)
d = PyModule_GetDict(m);
PyDict_SetItemString(
- d, "MAGIC", (PyObject*) PyInt_FromLong(SRE_MAGIC)
+ d, "MAGIC", (x = (PyObject*) PyInt_FromLong(SRE_MAGIC))
);
+ Py_XDECREF(x);
PyDict_SetItemString(
- d, "copyright", (PyObject*) PyString_FromString(copyright)
+ d, "copyright", (x = (PyObject*)PyString_FromString(copyright))
);
+ Py_XDECREF(x);
}