Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b7f1b38 + 36577e4 commit 597696cCopy full SHA for 597696c
1 file changed
Python/frozenmain.c
@@ -20,9 +20,16 @@ Py_FrozenMain(int argc, char **argv)
20
int inspect = 0;
21
int unbuffered = 0;
22
char *oldloc;
23
- wchar_t **argv_copy = PyMem_Malloc(sizeof(wchar_t*)*argc);
+ wchar_t **argv_copy;
24
/* We need a second copies, as Python might modify the first one. */
25
- wchar_t **argv_copy2 = PyMem_Malloc(sizeof(wchar_t*)*argc);
+ wchar_t **argv_copy2;
26
+
27
+ argv_copy = PyMem_Malloc(sizeof(wchar_t*)*argc);
28
+ argv_copy2 = PyMem_Malloc(sizeof(wchar_t*)*argc);
29
+ if (!argv_copy || !argv_copy2) {
30
+ fprintf(stderr, "out of memory\n");
31
+ return 1;
32
+ }
33
34
Py_FrozenFlag = 1; /* Suppress errors from getpath.c */
35
0 commit comments