Kaydet (Commit) 0b300be8 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Fix more memory leaks. Will backport to 2.4.

üst c3547a31
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment