1
0
mirror of https://github.com/golang/go synced 2024-11-23 06:10:05 -07:00

cmd/ld: fix 'use after free' error in new obj code

Many thanks to Elias Naur for finding this with Valgrind on Linux.
Perhaps this is what is breaking the windows/amd64 builder.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7595044
This commit is contained in:
Russ Cox 2013-03-12 17:57:13 -04:00
parent 5dc1e0f245
commit f7ad816c5c

View File

@ -528,7 +528,7 @@ ldhostobj(void (*ld)(Biobuf*, char*, int64, char*), Biobuf *f, char *pkg, int64
} }
h = &hostobj[nhostobj++]; h = &hostobj[nhostobj++];
h->ld = ld; h->ld = ld;
h->pkg = pkg; h->pkg = estrdup(pkg);
h->pn = estrdup(pn); h->pn = estrdup(pn);
h->file = estrdup(file); h->file = estrdup(file);
h->off = Boffset(f); h->off = Boffset(f);