* canon-host.c (canon_host_r): Set *cherror on memory allocation
authorDerek R. Price <derek@ximbiot.com>
Tue, 13 Sep 2005 13:23:57 +0000 (13:23 +0000)
committerDerek R. Price <derek@ximbiot.com>
Tue, 13 Sep 2005 13:23:57 +0000 (13:23 +0000)
failure.
Reported by Jim Meyering  <jim@meyering.net>.

lib/ChangeLog
lib/canon-host.c

index c9eda88d7b72b020c195e8b4ecd8129049a13d7d..20d8109a90d6d8c85b2c7fe5afb01949b3a85751 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-13  Derek Price  <derek@ximbiot.com>
+
+       * canon-host.c (canon_host_r): Set *cherror on memory allocation
+       failure.
+       Reported by Jim Meyering  <jim@meyering.net>.
+
 2005-09-13  Jim Meyering  <jim@meyering.net>
 
        * canon-host.c: Filter through gnu indent and reword comments slightly.
index dcbec53385c1edd087d39fad9b9abaae2555dd23..e2bd1a773b0cebf8d2232e49322dd13e25d3f38e 100644 (file)
@@ -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)