Core and Builtins
-----------------
+- Issue #15900: Fixed reference leak in PyUnicode_TranslateCharmap().
+
- Issue #15926: Fix crash after multiple reinitializations of the interpreter.
- Issue #15895: Fix FILE pointer leak in one error branch of
PyObject *mapping,
const char *errors)
{
+ PyObject *result;
PyObject *unicode = PyUnicode_FromUnicode(p, size);
if (!unicode)
return NULL;
- return _PyUnicode_TranslateCharmap(unicode, mapping, errors);
+ result = _PyUnicode_TranslateCharmap(unicode, mapping, errors);
+ Py_DECREF(unicode);
+ return result;
}
PyObject *
str = PyUnicode_FromObject(str);
if (str == NULL)
- goto onError;
+ return NULL;
result = _PyUnicode_TranslateCharmap(str, mapping, errors);
Py_DECREF(str);
return result;
-
- onError:
- Py_XDECREF(str);
- return NULL;
}
static Py_UCS4