diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 616c8362ee1..7461f60fa32 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2704,6 +2704,8 @@ socket_getaddrinfo(PyObject *self, PyObject *args) goto err; Py_XDECREF(single); } + if (res0) + freeaddrinfo(res0); return all; err: Py_XDECREF(single);