8000 gh-131311: Fix additional memory leaks in ctypes by sergey-miryanov · Pull Request #131429 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131311: Fix additional memory leaks in ctypes #131429

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

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Check Pointer_item result while constructing result list in Pointer_s…
…ubscript
  • Loading branch information
sergey-miryanov committed Mar 18, 2025
commit 2038b589113067b63bbad5e60a109df227eec38b
4 changes: 4 additions & 0 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5653,6 +5653,10 @@ Pointer_subscript(PyObject *myself, PyObject *item)

for (cur = start, i = 0; i < len; cur += step, i++) {
PyObject *v = Pointer_item(myself, cur);
if (!v) {
Py_DECREF(np);
return NULL;
}
PyList_SET_ITEM(np, i, v);
}
return np;
Expand Down
Loading
0