mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-12 14:21:18 +08:00
gethosts: Return EAI_MEMORY on allocation failure
All other cases of failures due to lack of memory return EAI_MEMORY, so it seems wrong to return EAI_SYSTEM here. The only reason convert_hostent_to_gaih_addrtuple could fail is on calloc failure. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
parent
ac4653ef50
commit
b587456c0e
@ -303,13 +303,13 @@ gethosts (nss_gethostbyname3_r fct, int family, const char *name,
|
||||
else if (status == NSS_STATUS_SUCCESS)
|
||||
{
|
||||
if (!convert_hostent_to_gaih_addrtuple (req, family, &th, res))
|
||||
return -EAI_SYSTEM;
|
||||
return -EAI_MEMORY;
|
||||
|
||||
if (localcanon != NULL && res->canon == NULL)
|
||||
{
|
||||
char *canonbuf = __strdup (localcanon);
|
||||
if (canonbuf == NULL)
|
||||
return -EAI_SYSTEM;
|
||||
return -EAI_MEMORY;
|
||||
res->canon = canonbuf;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user