mirror of
https://github.com/golang/go
synced 2024-11-20 03:24:41 -07:00
cmd/6c, cmd/8c: fix stack allocated Biobuf leaking at exit
Fixes #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://golang.org/cl/7844044
This commit is contained in:
parent
b35019fe9a
commit
f701e1c320
@ -320,7 +320,7 @@ outcode(void)
|
|||||||
zaddr(&b, &p->from, sf);
|
zaddr(&b, &p->from, sf);
|
||||||
zaddr(&b, &p->to, st);
|
zaddr(&b, &p->to, st);
|
||||||
}
|
}
|
||||||
Bflush(&b);
|
Bterm(&b);
|
||||||
close(f);
|
close(f);
|
||||||
firstp = P;
|
firstp = P;
|
||||||
lastp = P;
|
lastp = P;
|
||||||
|
@ -324,7 +324,7 @@ outcode(void)
|
|||||||
zaddr(&b, &p->from, sf);
|
zaddr(&b, &p->from, sf);
|
||||||
zaddr(&b, &p->to, st);
|
zaddr(&b, &p->to, st);
|
||||||
}
|
}
|
||||||
Bflush(&b);
|
Bterm(&b);
|
||||||
close(f);
|
close(f);
|
||||||
firstp = P;
|
firstp = P;
|
||||||
lastp = P;
|
lastp = P;
|
||||||
|
Loading…
Reference in New Issue
Block a user