diff options
| author | Tim Peters <tim.peters@gmail.com> | 2001-09-11 02:00:50 +0000 |
|---|---|---|
| committer | Tim Peters <tim.peters@gmail.com> | 2001-09-11 02:00:50 +0000 |
| commit | 0ebeb584a496fec7a09bd62cb20ceb15cabde4e7 (patch) | |
| tree | e7151d7f832a6ef653b4b6cba9d73f77c9cc6417 | |
| parent | c636f565b4f7c36387c3f6cdc196f797fc04c59f (diff) | |
| download | cpython-git-0ebeb584a496fec7a09bd62cb20ceb15cabde4e7.tar.gz | |
PyUnicode_FromEncodedObject(): Repair memory leak in an error case.
| -rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
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)) { |
