diff options
author | Guido van Rossum <guido@python.org> | 1997-09-03 18:19:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-09-03 18:19:40 (GMT) |
commit | 9efe8ef7a143d92cdf724c76f6bcf3f5c1ed7a66 (patch) | |
tree | 1a52a8f94189f7c613b8c41fffd7eff7f6a1a594 /Modules/cStringIO.c | |
parent | c3beda2f277a003deca2fd0f9b2ae8538d317087 (diff) | |
download | cpython-9efe8ef7a143d92cdf724c76f6bcf3f5c1ed7a66.zip cpython-9efe8ef7a143d92cdf724c76f6bcf3f5c1ed7a66.tar.gz cpython-9efe8ef7a143d92cdf724c76f6bcf3f5c1ed7a66.tar.bz2 |
#Plug small memory leaks in constructors.
Diffstat (limited to 'Modules/cStringIO.c')
-rw-r--r-- | Modules/cStringIO.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c index b08c899..ff47b70 100644 --- a/Modules/cStringIO.c +++ b/Modules/cStringIO.c @@ -600,7 +600,7 @@ static struct PycStringIO_CAPI CAPI = { void initcStringIO() { - PyObject *m, *d; + PyObject *m, *d, *v; /* Create the module and add the functions */ @@ -614,7 +614,9 @@ initcStringIO() { /* Export C API */ Itype.ob_type=&PyType_Type; Otype.ob_type=&PyType_Type; - PyDict_SetItemString(d,"cStringIO_CAPI", PyCObject_FromVoidPtr(&CAPI,NULL)); + PyDict_SetItemString(d,"cStringIO_CAPI", + v = PyCObject_FromVoidPtr(&CAPI,NULL)); + Py_XDECREF(v); /* Export Types */ PyDict_SetItemString(d,"InputType", (PyObject*)&Itype); @@ -631,6 +633,9 @@ initcStringIO() { /****************************************************************************** $Log$ + Revision 2.8 1997/09/03 18:19:38 guido + #Plug small memory leaks in constructors. + Revision 2.7 1997/09/03 00:09:26 guido Fix the bug Jeremy was experiencing: both the close() and the dealloc() functions contained code to free/DECREF the buffer |