summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-02 03:00:42 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-02 03:00:42 (GMT)
commit05f7c50bfd68ed0efc68145ff029b1509685751d (patch)
treea6d2ea2fc04626c395be0999b47b0104242b80d8 /Modules/main.c
parenteb46d67ce5f4906bdae80458080e5e6bfff6512b (diff)
downloadcpython-05f7c50bfd68ed0efc68145ff029b1509685751d.zip
cpython-05f7c50bfd68ed0efc68145ff029b1509685751d.tar.gz
cpython-05f7c50bfd68ed0efc68145ff029b1509685751d.tar.bz2
Free the malloc'ed buffer that holds the command once we're done with it.
Instead of calling Py_Exit(sts), call Py_Cleanup() and return sts.
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 5abf2a6..5140c4f 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -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;
}