summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorstratakis <cstratak@redhat.com>2019-03-14 15:10:58 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-03-14 15:10:58 (GMT)
commit2832ad53358e3fbc4bdc601b9f3fa04dd0deae46 (patch)
tree76e863a8d9e18d9dbe4c56e347e565031a6b69bd /Modules
parentce5c7a93d47e07327d19dfb47a967f1b18b7d6e8 (diff)
downloadcpython-2832ad53358e3fbc4bdc601b9f3fa04dd0deae46.zip
cpython-2832ad53358e3fbc4bdc601b9f3fa04dd0deae46.tar.gz
cpython-2832ad53358e3fbc4bdc601b9f3fa04dd0deae46.tar.bz2
[2.7] bpo-36212: Fix two possible reference leaks in the hotshot module (GH-12327)
Fix reference leaks in _hotshot.LogReaderType on PyTuple_New() failure.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_hotshot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 33cd38d..4fc5cee 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -482,8 +482,11 @@ restart:
}
else if (!err) {
result = PyTuple_New(4);
- if (result == NULL)
+ if (result == NULL) {
+ Py_XDECREF(s1);
+ Py_XDECREF(s2);
return NULL;
+ }
PyTuple_SET_ITEM(result, 0, PyInt_FromLong(what));
PyTuple_SET_ITEM(result, 2, PyInt_FromLong(fileno));
if (s1 == NULL)