From 639a9c73113836fec5694af9a938a6556e7dbc3c Mon Sep 17 00:00:00 2001 From: "Derek R. Price" Date: Tue, 13 Sep 2005 13:23:57 +0000 Subject: [PATCH] * canon-host.c (canon_host_r): Set *cherror on memory allocation failure. Reported by Jim Meyering . --- lib/ChangeLog | 6 ++++++ lib/canon-host.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/lib/ChangeLog b/lib/ChangeLog index c9eda88d7b..20d8109a90 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 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) -- 2.30.2