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/cPickle.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/cPickle.c')
-rw-r--r-- | Modules/cPickle.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 980fb28..b5fddd0 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -3876,7 +3876,7 @@ init_stuff(PyObject *module, PyObject *module_dict) { /* Initialization function for the module (*must* be called initcPickle) */ void initcPickle() { - PyObject *m, *d; + PyObject *m, *d, *v; char *rev="$Revision$"; PyObject *format_version; PyObject *compatible_formats; @@ -3893,7 +3893,8 @@ initcPickle() { /* Add some symbolic constants to the module */ d = PyModule_GetDict(m); PyDict_SetItemString(d,"__version__", - PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); + v = PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); + Py_XDECREF(v); #ifdef FORMAT_1_3 format_version = PyString_FromString("1.3"); @@ -3905,6 +3906,8 @@ initcPickle() { PyDict_SetItemString(d, "format_version", format_version); PyDict_SetItemString(d, "compatible_formats", compatible_formats); + Py_XDECREF(format_version); + Py_XDECREF(compatible_formats); init_stuff(m, d); CHECK_FOR_ERRORS("can't initialize module cPickle"); |