[Python-checkins] cpython: Issue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as

victor.stinner python-checkins at python.org
Sun Jul 7 22:58:06 CEST 2013


http://hg.python.org/cpython/rev/31a635303e55
changeset:   84501:31a635303e55
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sun Jul 07 22:57:45 2013 +0200
summary:
  Issue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as _Py_char2wchar()

files:
  Objects/unicodeobject.c |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4806,7 +4806,7 @@
    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 @@
        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;
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list