about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--sysdeps/mach/hurd/getcwd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/getcwd.c b/sysdeps/mach/hurd/getcwd.c
index d11f744b2c..6ca364a418 100644
--- a/sysdeps/mach/hurd/getcwd.c
+++ b/sysdeps/mach/hurd/getcwd.c
@@ -274,6 +274,8 @@ __hurd_canonicalize_directory_name_internal (file_t thisdir,
   /* Set errno.  */
   (void) __hurd_fail (err);
  lose:
+  if (orig_size == 0)
+    free (file_name);
   cleanup ();
   return NULL;
 }