diff mbox series

[hurd,commited] hurd: Fix spawni returning allocation errors.

Message ID 20231114225759.2297944-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series [hurd,commited] hurd: Fix spawni returning allocation errors. | expand

Commit Message

Samuel Thibault Nov. 14, 2023, 10:57 p.m. UTC
---
 sysdeps/mach/hurd/spawni.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c
index 5e05308066..9516001817 100644
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -787,12 +787,18 @@  retry:
       /* Relative path */
       char *cwd = __getcwd (NULL, 0);
       if (cwd == NULL)
-	goto out;
+	{
+	  err = errno;
+	  goto out;
+	}
 
       res = __asprintf (&concat_name, "%s/%s", cwd, relpath);
       free (cwd);
       if (res == -1)
-	goto out;
+	{
+	  err = errno;
+	  goto out;
+	}
 
       abspath = concat_name;
     }