Commit 8bbb6d3e authored by Russ Cox's avatar Russ Cox

cmd/ld: another use-after-free

This only shows up in the duplicate symbol error message.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7486053
parent e9d62a6d
......@@ -428,6 +428,7 @@ ldobj1(Biobuf *f, char *pkg, int64 len, char *pn)
ntext = 0;
eof = Boffset(f) + len;
src[0] = 0;
pn = estrdup(pn); // we keep it in Sym* references
newloop:
memset(h, 0, sizeof(h));
......
......@@ -423,6 +423,7 @@ ldobj1(Biobuf *f, char *pkg, int64 len, char *pn)
ntext = 0;
eof = Boffset(f) + len;
src[0] = 0;
pn = estrdup(pn); // we keep it in Sym* references
newloop:
memset(h, 0, sizeof(h));
......
......@@ -444,7 +444,7 @@ ldobj1(Biobuf *f, char *pkg, int64 len, char *pn)
ntext = 0;
eof = Boffset(f) + len;
src[0] = 0;
pn = estrdup(pn); // we keep it in Sym* references
newloop:
memset(h, 0, sizeof(h));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment