]> granicus.if.org Git - python/commitdiff
Free the malloc'ed buffer that holds the command once we're done with it.
authorGuido van Rossum <guido@python.org>
Sat, 2 Aug 1997 03:00:42 +0000 (03:00 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 2 Aug 1997 03:00:42 +0000 (03:00 +0000)
Instead of calling Py_Exit(sts), call Py_Cleanup() and return sts.

Modules/main.c

index 5abf2a67a1e7cdc7bfe53d77b462655d43cb0fd5..5140c4ff7691514769905c6c5aa5ef718004e62c 100644 (file)
@@ -216,6 +216,7 @@ Py_Main(argc, argv)
 
        if (command) {
                sts = PyRun_SimpleString(command) != 0;
+               free(command);
        }
        else {
                if (filename == NULL && stdin_is_interactive) {
@@ -240,8 +241,8 @@ Py_Main(argc, argv)
            (filename != NULL || command != NULL))
                sts = PyRun_AnyFile(stdin, "<stdin>") != 0;
 
-       Py_Exit(sts);
-       return 0; /* Make gcc -Wall happy */
+       Py_Cleanup();
+       return sts;
 }