Bruno Haible wrote:
I think the correction should be to put back the errno = ENOMEM;
statement (in __set_errno disguise, if you prefer that).

Thanks for catching that. I installed the attached.


>From 10dd4d106b699baaef466da21d796ddb80a7b5e5 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Thu, 18 Aug 2016 11:56:07 -0700
Subject: [PATCH] canonicalize-lgpl: fix errno after malloca fails

This fixes a typo I recently introduced.  Suggested by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00039.html
* lib/canonicalize-lgpl.c (__realpath):
Don't assume malloca sets errno on failure.
---
 ChangeLog               | 8 ++++++++
 lib/canonicalize-lgpl.c | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ff668a4..bee2cbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-08-18  Paul Eggert  <egg...@cs.ucla.edu>
+
+	canonicalize-lgpl: fix errno after malloca fails
+	This fixes a typo I recently introduced.  Suggested by Bruno Haible in:
+	http://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00039.html
+	* lib/canonicalize-lgpl.c (__realpath):
+	Don't assume malloca sets errno on failure.
+
 2016-08-17  Paul Eggert  <egg...@cs.ucla.edu>
 
 	strtod: port errno handling to z/OS
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index da83da3..4a38a46 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -285,7 +285,7 @@ __realpath (const char *name, char *resolved)
               buf = malloca (path_max);
               if (!buf)
                 {
-                  alloc_failed ();
+                  __set_errno (ENOMEM);
                   goto error;
                 }
 
-- 
2.7.4

Reply via email to