summaryrefslogtreecommitdiff
path: root/Modules/python.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/python.c')
-rw-r--r--Modules/python.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/python.c b/Modules/python.c
index 326aa36983..9811c01d49 100644
--- a/Modules/python.c
+++ b/Modules/python.c
@@ -45,6 +45,11 @@ main(int argc, char **argv)
#endif
oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
+ if (!oldloc) {
+ fprintf(stderr, "out of memory\n");
+ return 1;
+ }
+
setlocale(LC_ALL, "");
for (i = 0; i < argc; i++) {
argv_copy[i] = _Py_char2wchar(argv[i], NULL);