]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed ref count bug. Patch #411191. Found by Walter Dörwald.
authorMarc-André Lemburg <mal@egenix.com>
Sun, 25 Mar 2001 19:16:13 +0000 (19:16 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Sun, 25 Mar 2001 19:16:13 +0000 (19:16 +0000)
Objects/object.c

index e1dd470569b05f85eb6e228094efae7d45da5b40..47907bcb1d7f558ad6aa621f3303365bd61f209d 100644 (file)
@@ -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 {