projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3547a3
)
Fix more memory leaks. Will backport to 2.4.
author
Martin v. Löwis
<martin@v.loewis.de>
Wed, 1 Mar 2006 21:33:54 +0000
(21:33 +0000)
committer
Martin v. Löwis
<martin@v.loewis.de>
Wed, 1 Mar 2006 21:33:54 +0000
(21:33 +0000)
Python/modsupport.c
patch
|
blob
|
history
diff --git
a/Python/modsupport.c
b/Python/modsupport.c
index 2356a9e57eeb21b16071872469e8691a400ac3b3..f53e4c362ee8bebaa0be3f69dc15b543b244fb6a 100644
(file)
--- a/
Python/modsupport.c
+++ b/
Python/modsupport.c
@@
-71,13
+71,17
@@
Py_InitModule4(const char *name, PyMethodDef *methods, const char *doc,
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);