summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 4747a23..8659d72 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -6719,6 +6719,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
error = getaddrinfo(hptr, pptr, &hints, &res0);
Py_END_ALLOW_THREADS
if (error) {
+ res0 = NULL; /* avoid unexpected free if res0 becomes not NULL */
set_gaierror(error);
goto err;
}
@@ -6815,6 +6816,7 @@ socket_getnameinfo(PyObject *self, PyObject *args)
error = getaddrinfo(hostp, pbuf, &hints, &res);
Py_END_ALLOW_THREADS
if (error) {
+ res = NULL; /* avoid unexpected free if res becomes not NULL */
set_gaierror(error);
goto fail;
}