diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-20 03:05:13 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-20 03:05:13 +0200 |
commit | 0a4fae5c7e47a3ad5314160df05d00527f5922ab (patch) | |
tree | d3c934a4ed286d9a14388f5dbd4ae276b983df39 | |
parent | 2c2ff9db2a19f46cc47ecbf47a839dbca9927ca7 (diff) | |
download | cpython-0a4fae5c7e47a3ad5314160df05d00527f5922ab.tar.gz |
Fix reference leak in tb_printinternal()
Issue #26823.
-rw-r--r-- | Python/traceback.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index 15cde444f4..b33156eaa7 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -435,6 +435,7 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit) line = PyUnicode_FromFormat( " [Previous line repeated %d more times]\n", cnt-3); err = PyFile_WriteObject(line, f, Py_PRINT_RAW); + Py_DECREF(line); } last_file = tb->tb_frame->f_code->co_filename; last_line = tb->tb_lineno; @@ -456,6 +457,7 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit) line = PyUnicode_FromFormat( " [Previous line repeated %d more times]\n", cnt-3); err = PyFile_WriteObject(line, f, Py_PRINT_RAW); + Py_DECREF(line); } return err; } |