File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,11 +24,13 @@ Py_FrozenMain(int argc, char **argv)
2424 /* We need a second copies, as Python might modify the first one. */
2525 wchar_t * * argv_copy2 = NULL ;
2626
27- argv_copy = PyMem_RawMalloc (sizeof (wchar_t * ) * argc );
28- argv_copy2 = PyMem_RawMalloc (sizeof (wchar_t * ) * argc );
29- if (!argv_copy || !argv_copy2 ) {
30- fprintf (stderr , "out of memory\n" );
31- goto error ;
27+ if (argc > 0 ) {
28+ argv_copy = PyMem_RawMalloc (sizeof (wchar_t * ) * argc );
29+ argv_copy2 = PyMem_RawMalloc (sizeof (wchar_t * ) * argc );
30+ if (!argv_copy || !argv_copy2 ) {
31+ fprintf (stderr , "out of memory\n" );
32+ goto error ;
33+ }
3234 }
3335
3436 Py_FrozenFlag = 1 ; /* Suppress errors from getpath.c */
@@ -68,7 +70,8 @@ Py_FrozenMain(int argc, char **argv)
6870#ifdef MS_WINDOWS
6971 PyInitFrozenExtensions ();
7072#endif /* MS_WINDOWS */
71- Py_SetProgramName (argv_copy [0 ]);
73+ if (argc >= 1 )
74+ Py_SetProgramName (argv_copy [0 ]);
7275 Py_Initialize ();
7376#ifdef MS_WINDOWS
7477 PyWinFreeze_ExeInit ();
You can’t perform that action at this time.
0 commit comments