summaryrefslogtreecommitdiffstats
path: root/Python/frozenmain.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-26 23:13:34 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-26 23:13:34 (GMT)
commitb5245bec936d22fddb6d14bd130218ac71ed8474 (patch)
tree93c950b12c9726143fe80962dc7c8a854231fa56 /Python/frozenmain.c
parent597696c70cd18ec8b798b43ad38469b4e498b30d (diff)
downloadcpython-b5245bec936d22fddb6d14bd130218ac71ed8474.zip
cpython-b5245bec936d22fddb6d14bd130218ac71ed8474.tar.gz
cpython-b5245bec936d22fddb6d14bd130218ac71ed8474.tar.bz2
Issue #18203: Replace PyMem_Malloc() with PyMem_RawMalloc() at Python initialization
Diffstat (limited to 'Python/frozenmain.c')
-rw-r--r--Python/frozenmain.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index 98f46eb..3b64a6a 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -24,8 +24,8 @@ Py_FrozenMain(int argc, char **argv)
/* We need a second copies, as Python might modify the first one. */
wchar_t **argv_copy2;
- argv_copy = PyMem_Malloc(sizeof(wchar_t*)*argc);
- argv_copy2 = PyMem_Malloc(sizeof(wchar_t*)*argc);
+ argv_copy = PyMem_RawMalloc(sizeof(wchar_t*)*argc);
+ argv_copy2 = PyMem_RawMalloc(sizeof(wchar_t*)*argc);
if (!argv_copy || !argv_copy2) {
fprintf(stderr, "out of memory\n");
return 1;
@@ -62,7 +62,7 @@ Py_FrozenMain(int argc, char **argv)
fprintf(stderr, "Could not convert argument %d to string\n", i);
return 1;
}
- argv_copy[i] = PyMem_Malloc((argsize+1)*sizeof(wchar_t));
+ argv_copy[i] = PyMem_RawMalloc((argsize+1)*sizeof(wchar_t));
argv_copy2[i] = argv_copy[i];
if (!argv_copy[i]) {
fprintf(stderr, "out of memory\n");
@@ -109,9 +109,9 @@ Py_FrozenMain(int argc, char **argv)
#endif
Py_Finalize();
for (i = 0; i < argc; i++) {
- PyMem_Free(argv_copy2[i]);
+ PyMem_RawFree(argv_copy2[i]);
}
- PyMem_Free(argv_copy);
- PyMem_Free(argv_copy2);
+ PyMem_RawFree(argv_copy);
+ PyMem_RawFree(argv_copy2);
return sts;
}