mirror of https://github.com/python/cpython
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) {
|
if (command) {
|
||||||
sts = PyRun_SimpleString(command) != 0;
|
sts = PyRun_SimpleString(command) != 0;
|
||||||
|
free(command);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (filename == NULL && stdin_is_interactive) {
|
if (filename == NULL && stdin_is_interactive) {
|
||||||
|
@ -240,8 +241,8 @@ Py_Main(argc, argv)
|
||||||
(filename != NULL || command != NULL))
|
(filename != NULL || command != NULL))
|
||||||
sts = PyRun_AnyFile(stdin, "<stdin>") != 0;
|
sts = PyRun_AnyFile(stdin, "<stdin>") != 0;
|
||||||
|
|
||||||
Py_Exit(sts);
|
Py_Cleanup();
|
||||||
return 0; /* Make gcc -Wall happy */
|
return sts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue