From: Derek R. Price Date: Tue, 13 Sep 2005 13:23:57 +0000 (+0000) Subject: * canon-host.c (canon_host_r): Set *cherror on memory allocation X-Git-Tag: cvs-readonly~2956 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=639a9c73113836fec5694af9a938a6556e7dbc3c;p=gnulib.git * canon-host.c (canon_host_r): Set *cherror on memory allocation failure. Reported by Jim Meyering . --- diff --git a/lib/ChangeLog b/lib/ChangeLog index c9eda88d7..20d8109a9 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2005-09-13 Derek Price + + * canon-host.c (canon_host_r): Set *cherror on memory allocation + failure. + Reported by Jim Meyering . + 2005-09-13 Jim Meyering * canon-host.c: Filter through gnu indent and reword comments slightly. diff --git a/lib/canon-host.c b/lib/canon-host.c index dcbec5338..e2bd1a773 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)