summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-11 02:00:50 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-11 02:00:50 (GMT)
commit0ebeb584a496fec7a09bd62cb20ceb15cabde4e7 (patch)
treee7151d7f832a6ef653b4b6cba9d73f77c9cc6417 /Objects/unicodeobject.c
parentc636f565b4f7c36387c3f6cdc196f797fc04c59f (diff)
downloadcpython-0ebeb584a496fec7a09bd62cb20ceb15cabde4e7.zip
cpython-0ebeb584a496fec7a09bd62cb20ceb15cabde4e7.tar.gz
cpython-0ebeb584a496fec7a09bd62cb20ceb15cabde4e7.tar.bz2
PyUnicode_FromEncodedObject(): Repair memory leak in an error case.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a9b4eb2..98691fd 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)) {