mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 15:20:10 +00:00
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 commit352f4ff9a2
("resolv: Introduce struct resolv_context [BZ #21668]") and commit964263bb8d
("getaddrinfo: Release resolver context on error in gethosts [BZ #21885]"). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
parent
92ce43eef7
commit
8b222fa387
@ -288,6 +288,7 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
|
||||
canonbuf = __strdup (localcanon); \
|
||||
if (canonbuf == NULL) \
|
||||
{ \
|
||||
__resolv_context_put (res_ctx); \
|
||||
result = -EAI_SYSTEM; \
|
||||
goto free_and_return; \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user