Subject: bug#18145: memory leak in pwd

From: srinivas devaki <[email-masked]>
Date: Tue, 29 Jul 2014 12:32:04 +0530

i think there is a memory leak in pwd.c
I’m extremely sorry if this is wrong. I’m sending the git diff.

[eightnoteight@mr coreutils]$ git diff
diff --git a/src/pwd.c b/src/pwd.c
index 4993dfb..13d84cd 100644
--- a/src/pwd.c
+++ b/src/pwd.c
@@ -367,6 +367,7 @@ main (int argc, char **argv)
       if (wd)
         {
           puts (wd);
+          free (wd);
           exit (EXIT_SUCCESS);
         }
     }

and how can i contribute to gnu coreutils. how can i understand the code of
utils. which libraries should i get used to, before contributing to the gnu
coreutils.

Thanks !
​