[Python-checkins] r42741 - python/branches/release24-maint/Python/modsupport.c
martin.v.loewis
python-checkins at python.org
Wed Mar 1 22:36:35 CET 2006
Author: martin.v.loewis
Date: Wed Mar 1 22:36:32 2006
New Revision: 42741
Modified:
python/branches/release24-maint/Python/modsupport.c
Log:
Backport of memory leak fixes.
Modified: python/branches/release24-maint/Python/modsupport.c
==============================================================================
--- python/branches/release24-maint/Python/modsupport.c (original)
+++ python/branches/release24-maint/Python/modsupport.c Wed Mar 1 22:36:32 2006
@@ -71,13 +71,17 @@
PyErr_SetString(PyExc_ValueError,
"module functions cannot set"
" METH_CLASS or METH_STATIC");
+ Py_DECREF(n);
return NULL;
}
v = PyCFunction_NewEx(ml, passthrough, n);
- if (v == NULL)
+ if (v == NULL) {
+ Py_DECREF(n);
return NULL;
+ }
if (PyDict_SetItemString(d, ml->ml_name, v) != 0) {
Py_DECREF(v);
+ Py_DECREF(n);
return NULL;
}
Py_DECREF(v);
More information about the Python-checkins
mailing list