changeset: 84858:386ab2c12301 parent: 84856:ad90fc28769a parent: 84857:ab8121466785 user: Victor Stinner date: Sat Jul 27 01:05:49 2013 +0200 files: Modules/python.c description: (Merge 3.3) Issue #15893: frozenmain.c now handles PyMem_Malloc() failure diff -r ad90fc28769a -r 386ab2c12301 Python/frozenmain.c --- a/Python/frozenmain.c Sat Jul 27 00:33:35 2013 +0200 +++ b/Python/frozenmain.c Sat Jul 27 01:05:49 2013 +0200 @@ -20,9 +20,16 @@ int inspect = 0; int unbuffered = 0; char *oldloc; - wchar_t **argv_copy = PyMem_Malloc(sizeof(wchar_t*)*argc); + wchar_t **argv_copy; /* We need a second copies, as Python might modify the first one. */ - wchar_t **argv_copy2 = PyMem_Malloc(sizeof(wchar_t*)*argc); + wchar_t **argv_copy2; + + argv_copy = PyMem_Malloc(sizeof(wchar_t*)*argc); + argv_copy2 = PyMem_Malloc(sizeof(wchar_t*)*argc); + if (!argv_copy || !argv_copy2) { + fprintf(stderr, "out of memory\n"); + return 1; + } Py_FrozenFlag = 1; /* Suppress errors from getpath.c */

AltStyle によって変換されたページ (->オリジナル) /