diff Objects/classobject.c @ 30438:ef4a71f5af22 2.3

Fix leak in classobject.c. The leak surfaced on the error exit when hashing a class that does not define __hash__ but does define a comparison.
author Raymond Hettinger <python@rcn.com>
date Tue, 16 Sep 2003 07:13:56 +0000
parents e92c25d428b8
children 3b59fa5d25b1
line wrap: on
line diff
--- a/Objects/classobject.c	Tue Sep 16 05:29:50 2003 +0000
+++ b/Objects/classobject.c	Tue Sep 16 07:13:56 2003 +0000
@@ -953,6 +953,7 @@
 				return _Py_HashPointer(inst);
 			}
 		}
+		Py_XDECREF(func);
 		PyErr_SetString(PyExc_TypeError, "unhashable instance");
 		return -1;
 	}