There is a resource leak in gethosts after a strdup failure. We should fix this.
No extra test provided. To verify this you have to trigger the strdup failure manually and observe the resource leaks.
Author: Florian Weimer <email@example.com>
Date: Mon Jan 20 18:37:13 2020 +0100
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 <firstname.lastname@example.org>
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: glibc security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.