diff Objects/dictobject.c @ 39745:08ca476f8a34 legacy-trunk

Fix SF bug #1546288, crash in dict_equal.
author Neal Norwitz <nnorwitz@gmail.com>
date Tue, 05 Sep 2006 02:24:03 +0000
parents efa80633309d
children 796304efa268
line wrap: on
line diff
--- a/Objects/dictobject.c	Tue Sep 05 02:22:17 2006 +0000
+++ b/Objects/dictobject.c	Tue Sep 05 02:24:03 2006 +0000
@@ -1585,7 +1585,10 @@
 			/* temporarily bump aval's refcount to ensure it stays
 			   alive until we're done with it */
 			Py_INCREF(aval);
+			/* ditto for key */
+			Py_INCREF(key);
 			bval = PyDict_GetItem((PyObject *)b, key);
+			Py_DECREF(key);
 			if (bval == NULL) {
 				Py_DECREF(aval);
 				return 0;