summaryrefslogtreecommitdiff
path: root/lib/canon-host.c
diff options
context:
space:
mode:
authorDerek R. Price <derek@ximbiot.com>2005-09-13 13:23:57 +0000
committerDerek R. Price <derek@ximbiot.com>2005-09-13 13:23:57 +0000
commit639a9c73113836fec5694af9a938a6556e7dbc3c (patch)
treebf04c5c2ab32d39b84d6b1c46aa6a8398150d5c8 /lib/canon-host.c
parente44c0fd283edb9ed01a7789cf58f4254f0e582fe (diff)
downloadgnulib-639a9c73113836fec5694af9a938a6556e7dbc3c.tar.gz
* canon-host.c (canon_host_r): Set *cherror on memory allocation
failure. Reported by Jim Meyering <jim@meyering.net>.
Diffstat (limited to 'lib/canon-host.c')
-rw-r--r--lib/canon-host.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/canon-host.c b/lib/canon-host.c
index dcbec53385..e2bd1a773b 100644
--- a/lib/canon-host.c
+++ b/lib/canon-host.c
@@ -72,6 +72,8 @@ canon_host_r (char const *host, int *cherror)
if (!status)
{
retval = strdup (res->ai_canonname);
+ if (!retval && cherror)
+ *cherror = EAI_MEMORY;
freeaddrinfo (res);
}
else if (cherror)