diff options
author | Dave Cheney <dave@cheney.net> | 2013-03-20 23:42:00 +1100 |
---|---|---|
committer | Dave Cheney <dave@cheney.net> | 2013-03-20 23:42:00 +1100 |
commit | 84456e7a3fa158ee29dc7df163cd3be61aa07334 (patch) | |
tree | 6c283f93835e0a97f16175783b59922be193eec5 /src/cmd/8c | |
parent | 12e61cfa72f262acaeeaf560bde303b0c73bd8d1 (diff) | |
download | go-84456e7a3fa158ee29dc7df163cd3be61aa07334.tar.gz |
cmd/6c, cmd/8c: fix stack allocated Biobuf leaking at exit
Fixes issue 5085.
{6,8}c/swt.c allocates a third Biobuf in automatic memory which is not terminated at the end of the function. This causes the buffer to be 'in use' when the batexit handler fires, confusing valgrind.
Huge thanks to DMorsing for the diagnosis.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://codereview.appspot.com/7844044
Diffstat (limited to 'src/cmd/8c')
-rw-r--r-- | src/cmd/8c/swt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/8c/swt.c b/src/cmd/8c/swt.c index d331eee1a..1b8ceb0c6 100644 --- a/src/cmd/8c/swt.c +++ b/src/cmd/8c/swt.c @@ -324,7 +324,7 @@ outcode(void) zaddr(&b, &p->from, sf); zaddr(&b, &p->to, st); } - Bflush(&b); + Bterm(&b); close(f); firstp = P; lastp = P; |