churchyard / rpms / python3

Forked from rpms/python3 3 years ago
Clone

Blame 00279-fix-memory-corruption-due-to-allocator-mix.patch

22b8f2b
diff --git a/Modules/getpath.c b/Modules/getpath.c
22b8f2b
index c4055be..1258fcd 100644
22b8f2b
--- a/Modules/getpath.c
22b8f2b
+++ b/Modules/getpath.c
22b8f2b
@@ -735,7 +735,7 @@ calculate_path(void)
22b8f2b
     bufsz += wcslen(zip_path) + 1;
22b8f2b
     bufsz += wcslen(exec_prefix) + 1;
22b8f2b
 
22b8f2b
-    buf = PyMem_New(wchar_t, bufsz);
22b8f2b
+    buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t));
22b8f2b
     if (buf == NULL) {
22b8f2b
         Py_FatalError(
22b8f2b
             "Not enough memory for dynamic PYTHONPATH");