diff options
-rw-r--r-- | Objects/unicodeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d8f1ce1..42cda58 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -8665,7 +8665,7 @@ _PyUnicode_TranslateCharmap(PyObject *input, /* allocate enough for a simple 1:1 translation without replacements, if we need more, we'll resize */ osize = size; - output = PyMem_Malloc(osize * sizeof(Py_UCS4)); + output = PyMem_NEW(Py_UCS4, osize); opos = 0; if (output == NULL) { PyErr_NoMemory(); |