mirror of
https://github.com/python/cpython.git
synced 2024-11-25 02:44:06 +08:00
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.
This commit is contained in:
parent
eb46d67ce5
commit
05f7c50bfd
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user