]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* Python/pythonmain.c: fatal error if can't alloc mem for -c
authorGuido van Rossum <guido@python.org>
Thu, 29 Sep 1994 09:38:18 +0000 (09:38 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 29 Sep 1994 09:38:18 +0000 (09:38 +0000)
string

Python/pythonmain.c

index a41a55953f62c444297968793a4cfdd97f2c9948..4cf44dc666d2b29bea3ba3334b038887ba0d66c9 100644 (file)
@@ -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;