summaryrefslogtreecommitdiff
path: root/src/lib9
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-06-05 01:31:23 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-06-05 01:31:23 +0800
commitfaae1ff4a4714720a66f23320fd0a0e23b29e73a (patch)
tree7c81282e29e9c67e4e567602ecc8f3570bab075b /src/lib9
parent1a2e6a35b0a67c47c4c6d4130bd1a3ad743dd313 (diff)
downloadgo-faae1ff4a4714720a66f23320fd0a0e23b29e73a.tar.gz
lib9: fix memory leak in p9getwd()
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 http://codereview.appspot.com/6285046
Diffstat (limited to 'src/lib9')
-rw-r--r--src/lib9/getwd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib9/getwd.c b/src/lib9/getwd.c
index 3c8cafb3a..566d3f647 100644
--- a/src/lib9/getwd.c
+++ b/src/lib9/getwd.c
@@ -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)
{