8000 [Skip Issue] Fix a possible reference leak in _socket.getaddrinfo() by ZackerySpytz · Pull Request #10543 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[Skip Issue] Fix a possible reference leak in _socket.getaddrinfo() #10543

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 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
Fix a possible reference leak in _socket.getaddrinfo()
"single" needs to be decrefed if PyList_Append() fails.
  • Loading branch information
ZackerySpytz committed Nov 14, 2018
commit c55cea8693d10f1111c749dd5d013555a77f9c13
6 changes: 4 additions & 2 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6370,9 +6370,11 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
if (single == NULL)
goto err;

if (PyList_Append(all, single))
if (PyList_Append(all, single)) {
Py_DECREF(single);
goto err;
Py_XDECREF(single);
}
Py_DECREF(single);
}
Py_XDECREF(idna);
if (res0)
Expand Down
0