summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-09-29 09:38:18 (GMT)
committerGuido van Rossum <guido@python.org>1994-09-29 09:38:18 (GMT)
commita66e25dfa36d7abc7a21e70945d35312585e054f (patch)
tree7e72425b3745b74517f68f4ca65c232fa2de665d
parentbfd5d755a0edd12a8249fd690fd93b090829bf6c (diff)
downloadcpython-a66e25dfa36d7abc7a21e70945d35312585e054f.zip
cpython-a66e25dfa36d7abc7a21e70945d35312585e054f.tar.gz
cpython-a66e25dfa36d7abc7a21e70945d35312585e054f.tar.bz2
* Python/pythonmain.c: fatal error if can't alloc mem for -c
string
-rw-r--r--Python/pythonmain.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pythonmain.c b/Python/pythonmain.c
index a41a559..4cf44dc 100644
--- a/Python/pythonmain.c
+++ b/Python/pythonmain.c
@@ -71,7 +71,8 @@ realmain(argc, argv)
that look like options are left for the
the command to interpret. */
command = malloc(strlen(optarg) + 2);
- /* Ignore malloc errors this early... */
+ if (command == NULL)
+ fatal("not enough memory to copy -c argument");
strcpy(command, optarg);
strcat(command, "\n");
break;