Commit 2832ad53 authored by stratakis's avatar stratakis Committed by Victor Stinner

[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.
parent ce5c7a93
Fix two possible reference leaks in the hotshot module.
...@@ -482,8 +482,11 @@ restart: ...@@ -482,8 +482,11 @@ restart:
} }
else if (!err) { else if (!err) {
result = PyTuple_New(4); result = PyTuple_New(4);
if (result == NULL) if (result == NULL) {
Py_XDECREF(s1);
Py_XDECREF(s2);
return NULL; return NULL;
}
PyTuple_SET_ITEM(result, 0, PyInt_FromLong(what)); PyTuple_SET_ITEM(result, 0, PyInt_FromLong(what));
PyTuple_SET_ITEM(result, 2, PyInt_FromLong(fileno)); PyTuple_SET_ITEM(result, 2, PyInt_FromLong(fileno));
if (s1 == NULL) if (s1 == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment