diff Python/modsupport.c @ 26664:fe2d422385b1 legacy-trunk

Fixed potential crash: v can be NULL here, so use Py_XDECREF rather than Py_DECREF
author Just van Rossum <just@letterror.com>
date Sun, 15 Dec 2002 13:45:32 +0000
parents 64f4dd770c67
children 842d6a24497a
line wrap: on
line diff
--- a/Python/modsupport.c	Sun Dec 15 13:14:22 2002 +0000
+++ b/Python/modsupport.c	Sun Dec 15 13:45:32 2002 +0000
@@ -78,7 +78,7 @@
 	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);