Commit 2907d938 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub

Fix a possible reference leak in _socket.getaddrinfo(). (GH-10543)


"single" needs to be decrefed if PyList_Append() fails.
(cherry picked from commit 4c596d54)
Co-authored-by: default avatarZackery Spytz <zspytz@gmail.com>
parent b6f4472d
......@@ -4249,9 +4249,11 @@ socket_getaddrinfo(PyObject *self, PyObject *args)
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)
......
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