From: Tim Peters Date: Tue, 11 Sep 2001 02:00:50 +0000 (+0000) Subject: PyUnicode_FromEncodedObject(): Repair memory leak in an error case. X-Git-Tag: v2.2.1c1~1866 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ebeb584a496fec7a09bd62cb20ceb15cabde4e7;p=python PyUnicode_FromEncodedObject(): Repair memory leak in an error case. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a9b4eb2fc6..98691fddcd 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -424,13 +424,13 @@ PyObject *PyUnicode_FromEncodedObject(register PyObject *obj, owned = 1; } if (PyUnicode_Check(obj)) { - Py_INCREF(obj); - v = obj; if (encoding) { PyErr_SetString(PyExc_TypeError, "decoding Unicode is not supported"); return NULL; } + Py_INCREF(obj); + v = obj; goto done; } else if (PyString_Check(obj)) {