Skip to content

Commit 8bfdf89

Browse files
Add more missing decrefs.
1 parent fbbebfd commit 8bfdf89

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/_xxinterpchannelsmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,7 @@ _channel_end_from_xid(_PyCrossInterpreterData *data)
20132013
}
20142014
PyTypeObject *cls = _get_current_channel_end_type(cid->end);
20152015
if (cls == NULL) {
2016+
Py_DECREF(cid);
20162017
return NULL;
20172018
}
20182019
PyObject *obj = PyObject_CallOneArg((PyObject *)cls, (PyObject *)cid);
@@ -2028,7 +2029,9 @@ _channel_end_shared(PyThreadState *tstate, PyObject *obj,
20282029
if (cidobj == NULL) {
20292030
return -1;
20302031
}
2031-
if (_channelid_shared(tstate, cidobj, data) < 0) {
2032+
int res = _channelid_shared(tstate, cidobj, data);
2033+
Py_DECREF(cidobj);
2034+
if (res < 0) {
20322035
return -1;
20332036
}
20342037
data->new_object = _channel_end_from_xid;

0 commit comments

Comments
 (0)