]> git.ipfire.org Git - thirdparty/glibc.git/commit
getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]
authorFlorian Weimer <fweimer@redhat.com>
Mon, 20 Jan 2020 17:37:13 +0000 (18:37 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 20 Jan 2020 17:37:13 +0000 (18:37 +0100)
commit8b222fa38700422b4da6731806835f0bbf40920d
treebb0c933e2a35c97558970771e473095f7c2cd953
parent92ce43eef7ac844782d50a8015d977d216fbadec
getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]

Filip Ochnik spotted that one of the error jumps in gethosts fails to
call __resolv_context_put to release the resolver context.

Fixes commit 352f4ff9a268b81ef5d4b2413f582565806e4790 ("resolv:
Introduce struct resolv_context [BZ #21668]") and commit
964263bb8d650f1681665c55704fb01a8e725621 ("getaddrinfo: Release
resolver context on error in gethosts [BZ #21885]").

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
sysdeps/posix/getaddrinfo.c