public inbox for
help / color / mirror / Atom feed
From: Samuel Thibault <>
Subject: [glibc] hurd getcwd: Fix memory leak on error
Date: Mon,  2 Jan 2023 10:36:46 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=5f55b22f4b3ea14c777a60f239d25dc4555eb804

commit 5f55b22f4b3ea14c777a60f239d25dc4555eb804
Author: Samuel Thibault <>
Date:   Mon Jan 2 01:59:53 2023 +0100

    hurd getcwd: Fix memory leak on error

 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);
+  if (orig_size == 0)
+    free (file_name);
   cleanup ();
   return NULL;

                 reply	other threads:[~2023-01-02 10:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).