diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-02 01:59:53 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-02 11:36:11 +0100 |
commit | 5f55b22f4b3ea14c777a60f239d25dc4555eb804 (patch) | |
tree | 6246faa2517dc9308976a98399def3274daed5e8 | |
parent | e1a467d330d2dd4ab83adcadeba75961952ec826 (diff) | |
download | glibc-5f55b22f4b3ea14c777a60f239d25dc4555eb804.zip glibc-5f55b22f4b3ea14c777a60f239d25dc4555eb804.tar.gz glibc-5f55b22f4b3ea14c777a60f239d25dc4555eb804.tar.bz2 |
hurd getcwd: Fix memory leak on error
-rw-r--r-- | sysdeps/mach/hurd/getcwd.c | 2 |
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; } |