mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
PyUnicode_FromEncodedObject(): Repair memory leak in an error case.
This commit is contained in:
parent
c636f565b4
commit
0ebeb584a4
1 changed files with 2 additions and 2 deletions
|
@ -424,13 +424,13 @@ PyObject *PyUnicode_FromEncodedObject(register PyObject *obj,
|
||||||
owned = 1;
|
owned = 1;
|
||||||
}
|
}
|
||||||
if (PyUnicode_Check(obj)) {
|
if (PyUnicode_Check(obj)) {
|
||||||
Py_INCREF(obj);
|
|
||||||
v = obj;
|
|
||||||
if (encoding) {
|
if (encoding) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
"decoding Unicode is not supported");
|
"decoding Unicode is not supported");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Py_INCREF(obj);
|
||||||
|
v = obj;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (PyString_Check(obj)) {
|
else if (PyString_Check(obj)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue