summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2001-03-25 19:16:13 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2001-03-25 19:16:13 (GMT)
commitae605341e3eb9e6426db07660ac57675ae86e2b6 (patch)
tree8e753dc266bc1b3e5fb6d31538f1308e14f215af /Objects
parent4113b137cd9e02efe65d66ad2b671bbb9e5164dd (diff)
downloadcpython-ae605341e3eb9e6426db07660ac57675ae86e2b6.zip
cpython-ae605341e3eb9e6426db07660ac57675ae86e2b6.tar.gz
cpython-ae605341e3eb9e6426db07660ac57675ae86e2b6.tar.bz2
Fixed ref count bug. Patch #411191. Found by Walter Dörwald.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index e1dd470..47907bc 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -346,8 +346,10 @@ PyObject_Unicode(PyObject *v)
Py_INCREF(v);
return v;
}
- else if (PyString_Check(v))
+ else if (PyString_Check(v)) {
+ Py_INCREF(v);
res = v;
+ }
else if (v->ob_type->tp_str != NULL)
res = (*v->ob_type->tp_str)(v);
else {