summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-09-05 02:24:03 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-09-05 02:24:03 (GMT)
commita22975fb35e1bae0f85fc6ede1572264a7bcd1e6 (patch)
tree4010d55ca48619982bced6b5d41dacd575c6b350 /Objects/dictobject.c
parentc4a70fbb78211261c9edf4a80029a124bb3cc826 (diff)
downloadcpython-a22975fb35e1bae0f85fc6ede1572264a7bcd1e6.zip
cpython-a22975fb35e1bae0f85fc6ede1572264a7bcd1e6.tar.gz
cpython-a22975fb35e1bae0f85fc6ede1572264a7bcd1e6.tar.bz2
Fix SF bug #1546288, crash in dict_equal.
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index f3b6b7f..4e82798 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1585,7 +1585,10 @@ dict_equal(dictobject *a, dictobject *b)
/* 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;