err_input(): Nailed a small memory leak. If the error is E_INTR, the
v temporary variable was never decref'd. Test this by starting up the interpreter, hitting C-c, then immediately exiting. Same potential leak can occur if error is E_NOMEM, since the return is done in the case block. Added Py_XDECREF(v); to both blocks, just before the return.
This commit is contained in:
parent
54892c4b2c
commit
c80baa3365
|
@ -992,13 +992,14 @@ err_input(err)
|
||||||
break;
|
break;
|
||||||
case E_TOKEN:
|
case E_TOKEN:
|
||||||
msg = "invalid token";
|
msg = "invalid token";
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case E_INTR:
|
case E_INTR:
|
||||||
PyErr_SetNone(PyExc_KeyboardInterrupt);
|
PyErr_SetNone(PyExc_KeyboardInterrupt);
|
||||||
|
Py_XDECREF(v);
|
||||||
return;
|
return;
|
||||||
case E_NOMEM:
|
case E_NOMEM:
|
||||||
PyErr_NoMemory();
|
PyErr_NoMemory();
|
||||||
|
Py_XDECREF(v);
|
||||||
return;
|
return;
|
||||||
case E_EOF:
|
case E_EOF:
|
||||||
msg = "unexpected EOF while parsing";
|
msg = "unexpected EOF while parsing";
|
||||||
|
|
Loading…
Reference in New Issue