aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-02 01:59:53 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-02 11:36:11 +0100
commit5f55b22f4b3ea14c777a60f239d25dc4555eb804 (patch)
tree6246faa2517dc9308976a98399def3274daed5e8
parente1a467d330d2dd4ab83adcadeba75961952ec826 (diff)
downloadglibc-5f55b22f4b3ea14c777a60f239d25dc4555eb804.zip
glibc-5f55b22f4b3ea14c777a60f239d25dc4555eb804.tar.gz
glibc-5f55b22f4b3ea14c777a60f239d25dc4555eb804.tar.bz2
hurd getcwd: Fix memory leak on error
-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 d11f744..6ca364a 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;
}