hurd getcwd: Fix memory leak on error

This commit is contained in:
Samuel Thibault 2023-01-02 01:59:53 +01:00
parent e1a467d330
commit 5f55b22f4b
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}