]> Cypherpunks repositories - gostls13.git/commitdiff
lib9: fix memory leak in p9getwd()
authorShenghou Ma <minux.ma@gmail.com>
Mon, 4 Jun 2012 17:31:23 +0000 (01:31 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Mon, 4 Jun 2012 17:31:23 +0000 (01:31 +0800)
        although the comment says it uses libc's getenv, without NOPLAN9DEFINES
        it actually uses p9getenv which strdups.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6285046

src/lib9/getwd.c

index 3c8cafb3a0061d09b055e7a05ae44d89b0a8240a..566d3f647abcd36f48a44f78a7a0bfa9857dc3dd 100644 (file)
@@ -26,10 +26,9 @@ THE SOFTWARE.
 #include <u.h>
 #include <errno.h>
 #include <sys/stat.h>
+#define NOPLAN9DEFINES
 #include <libc.h>
 
-#undef getwd
-
 char*
 p9getwd(char *s, int ns)
 {