Commit bbfd8595 authored by Just van Rossum's avatar Just van Rossum

Fixed potential crash: v can be NULL here, so use Py_XDECREF rather than Py_DECREF

parent edd179ee
...@@ -78,7 +78,7 @@ Py_InitModule4(char *name, PyMethodDef *methods, char *doc, ...@@ -78,7 +78,7 @@ Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
if (doc != NULL) { if (doc != NULL) {
v = PyString_FromString(doc); v = PyString_FromString(doc);
if (v == NULL || PyDict_SetItemString(d, "__doc__", v) != 0) { if (v == NULL || PyDict_SetItemString(d, "__doc__", v) != 0) {
Py_DECREF(v); Py_XDECREF(v);
return NULL; return NULL;
} }
Py_DECREF(v); 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