Merged revisions 59212-59225 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r59218 | georg.brandl | 2007-11-29 09:01:20 -0800 (Thu, 29 Nov 2007) | 2 lines

  Fix reference target.
........
  r59219 | georg.brandl | 2007-11-29 09:02:34 -0800 (Thu, 29 Nov 2007) | 4 lines

  Add examples to the ConfigParser documentation.

  Credits go to Thomas Lamb, who wrote this as a task in the GHOP contest.
........
  r59223 | guido.van.rossum | 2007-11-29 10:25:12 -0800 (Thu, 29 Nov 2007) | 2 lines

  Fix bug #1517, a segfault in lookdict().
........
  r59224 | georg.brandl | 2007-11-29 10:33:01 -0800 (Thu, 29 Nov 2007) | 2 lines

  Spaces vs. Tabs.
........
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index b849f57..d1ebf1f 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -270,7 +270,9 @@
 	else {
 		if (ep->me_hash == hash) {
 			startkey = ep->me_key;
+			Py_INCREF(startkey);
 			cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
+			Py_DECREF(startkey);
 			if (cmp < 0)
 				return NULL;
 			if (ep0 == mp->ma_table && ep->me_key == startkey) {
@@ -300,7 +302,9 @@
 			return ep;
 		if (ep->me_hash == hash && ep->me_key != dummy) {
 			startkey = ep->me_key;
+			Py_INCREF(startkey);
 			cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
+			Py_DECREF(startkey);
 			if (cmp < 0)
 				return NULL;
 			if (ep0 == mp->ma_table && ep->me_key == startkey) {