]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#10122...
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Sun, 22 Jan 2023 08:47:01 +0000 (14:17 +0530)
committerGitHub <noreply@github.com>
Sun, 22 Jan 2023 08:47:01 +0000 (14:17 +0530)
Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)"

This reverts commit 5f08fe4a2c055880c23c6f9b57ff03005d193bfc.

Misc/NEWS.d/next/Library/2023-01-21-16-50-22.gh-issue-100795.NPMZf7.rst [deleted file]
Modules/socketmodule.c

diff --git a/Misc/NEWS.d/next/Library/2023-01-21-16-50-22.gh-issue-100795.NPMZf7.rst b/Misc/NEWS.d/next/Library/2023-01-21-16-50-22.gh-issue-100795.NPMZf7.rst
deleted file mode 100644 (file)
index beec5c9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Avoid unexpected ``freeaddrinfo`` when :meth:`socket.socket.getaddrinfo`
-fails. Patch by Sergey G. Brester.
index 8659d725f2e3a3b08b8b4c52355516754d6e541c..4747a23e8317fd8869cf08f20ecfa0c030768736 100644 (file)
@@ -6719,7 +6719,6 @@ 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;
     }
@@ -6816,7 +6815,6 @@ 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;
     }