]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed potential crash: v can be NULL here, so use Py_XDECREF rather than Py_DECREF
authorJust van Rossum <just@letterror.com>
Sun, 15 Dec 2002 13:45:32 +0000 (13:45 +0000)
committerJust van Rossum <just@letterror.com>
Sun, 15 Dec 2002 13:45:32 +0000 (13:45 +0000)
Python/modsupport.c

index 98b0341330187858078beb473fb5d59ebf3d08ae..a2a095ed3e1f4e7101b1a1e7c1eb422696931dbd 100644 (file)
@@ -78,7 +78,7 @@ Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
        if (doc != NULL) {
                v = PyString_FromString(doc);
                if (v == NULL || PyDict_SetItemString(d, "__doc__", v) != 0) {
-                       Py_DECREF(v);
+                       Py_XDECREF(v);
                        return NULL;
                }
                Py_DECREF(v);