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.
This commit is contained in:
Raymond Hettinger 2003-09-16 07:11:46 +00:00
parent 2d72b5d707
commit a9e14b7015
1 changed files with 1 additions and 0 deletions

View File

@ -953,6 +953,7 @@ instance_hash(PyInstanceObject *inst)
return _Py_HashPointer(inst);
}
}
Py_XDECREF(func);
PyErr_SetString(PyExc_TypeError, "unhashable instance");
return -1;
}