changeset 6230:39a1eb442649

* canon-host.c (canon_host_r): Set *cherror on memory allocation failure. Reported by Jim Meyering <jim@meyering.net>.
author Derek R. Price <derek@ximbiot.com>
date Tue, 13 Sep 2005 13:23:57 +0000
parents a0291ab799fb
children 9bc18edac6c9
files lib/ChangeLog lib/canon-host.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -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.
--- a/lib/canon-host.c
+++ b/lib/canon-host.c
@@ -72,6 +72,8 @@
   if (!status)
     {
       retval = strdup (res->ai_canonname);
+      if (!retval && cherror)
+	*cherror = EAI_MEMORY;
       freeaddrinfo (res);
     }
   else if (cherror)