public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd getcwd: Fix memory leak on error
@ 2023-01-02 10:36 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2023-01-02 10:36 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5f55b22f4b3ea14c777a60f239d25dc4555eb804

commit 5f55b22f4b3ea14c777a60f239d25dc4555eb804
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Jan 2 01:59:53 2023 +0100

    hurd getcwd: Fix memory leak on error

Diff:
---
 sysdeps/mach/hurd/getcwd.c | 2 ++
 1 file changed, 2 insertions(+)

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-02 10:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 10:36 [glibc] hurd getcwd: Fix memory leak on error Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).