Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-116099: Fix refcounting bug in _queueobj_shared() #116164

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Modules/_xxinterpqueuesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,20 +1189,18 @@
.label = "queue ID",
};
int res = idarg_int64_converter(qidobj, &converted);
Py_DECREF(qidobj);
Py_CLEAR(qidobj);
if (!res) {
assert(PyErr_Occurred());
return -1;
}

void *raw = _queueid_xid_new(converted.id);
if (raw == NULL) {
Py_DECREF(qidobj);
return -1;
}
_PyCrossInterpreterData_Init(data, tstate->interp, raw, NULL,
_queueobj_from_xid);
Py_DECREF(qidobj);
_PyCrossInterpreterData_SET_FREE(data, _queueid_xid_free);
return 0;
}
Expand Down Expand Up @@ -1429,7 +1427,7 @@
return NULL;
}

PyObject *res = Py_BuildValue("Oi", obj, fmt);

Check warning on line 1430 in Modules/_xxinterpqueuesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘fmt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Py_DECREF(obj);
return res;
}
Expand Down
Loading