summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-07 20:57:45 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-07 20:57:45 (GMT)
commit6f8eeee7b9cae7e3f899c89baefe9acc575f2fb5 (patch)
tree5b32a6c6f41316d79d6ae64d51aaff44d93f1079 /Objects
parentfa535f5220592ed2bb668e2c6ddedf13a450d945 (diff)
downloadcpython-6f8eeee7b9cae7e3f899c89baefe9acc575f2fb5.zip
cpython-6f8eeee7b9cae7e3f899c89baefe9acc575f2fb5.tar.gz
cpython-6f8eeee7b9cae7e3f899c89baefe9acc575f2fb5.tar.bz2
Issue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as _Py_char2wchar()
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 3a4cc20..ac5f66a 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4806,7 +4806,7 @@ onError:
used to decode the command line arguments on Mac OS X.
Return a pointer to a newly allocated wide character string (use
- PyMem_Free() to free the memory), or NULL on memory allocation error. */
+ PyMem_RawFree() to free the memory), or NULL on memory allocation error. */
wchar_t*
_Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
@@ -4819,7 +4819,7 @@ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
character count */
if (PY_SSIZE_T_MAX / sizeof(wchar_t) < (size + 1))
return NULL;
- unicode = PyMem_Malloc((size + 1) * sizeof(wchar_t));
+ unicode = PyMem_RawMalloc((size + 1) * sizeof(wchar_t));
if (!unicode)
return NULL;