]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-100795: Don't call freeaddrinfo on failure. (GH-101252)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 23 Jan 2023 23:27:41 +0000 (15:27 -0800)
committerGitHub <noreply@github.com>
Mon, 23 Jan 2023 23:27:41 +0000 (15:27 -0800)
commit81266281073f498349d6e98563a6519e2b94a1c4
treec0b951c1445de727cfc8aaf6be9d95acbf19aebc
parente24c73e71e952028bc702a741241ff79c23eb30e
gh-100795: Don't call freeaddrinfo on failure. (GH-101252)

When getaddrinfo returns an error, the output pointer is in an unknown state
Don't call freeaddrinfo on it.  See the issue for discussion and details with
links to reasoning.  _Most_ libc getaddrinfo implementations never modify the
output pointer unless they are returning success.

(cherry picked from commit b724ac2fe7fbb5a7a33d639cad8e748f17b325e0)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Sergey G. Brester <github@sebres.de>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Misc/NEWS.d/next/Library/2023-01-21-16-50-22.gh-issue-100795.NPMZf7.rst [new file with mode: 0644]
Modules/socketmodule.c