mirror of
https://github.com/golang/go
synced 2024-11-25 01:08:02 -07:00
5l, 6l, 8l, ld: remove memory leaks
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5569085
This commit is contained in:
parent
ba31d662fe
commit
916eea04f8
@ -91,6 +91,7 @@ needlib(char *name)
|
||||
/* reuse hash code in symbol table */
|
||||
p = smprint(".dynlib.%s", name);
|
||||
s = lookup(p, 0);
|
||||
free(p);
|
||||
if(s->type == 0) {
|
||||
s->type = 100; // avoid SDATA, etc.
|
||||
return 1;
|
||||
|
@ -112,6 +112,7 @@ needlib(char *name)
|
||||
/* reuse hash code in symbol table */
|
||||
p = smprint(".elfload.%s", name);
|
||||
s = lookup(p, 0);
|
||||
free(p);
|
||||
if(s->type == 0) {
|
||||
s->type = 100; // avoid SDATA, etc.
|
||||
return 1;
|
||||
|
@ -108,6 +108,7 @@ needlib(char *name)
|
||||
/* reuse hash code in symbol table */
|
||||
p = smprint(".dynlib.%s", name);
|
||||
s = lookup(p, 0);
|
||||
free(p);
|
||||
if(s->type == 0) {
|
||||
s->type = 100; // avoid SDATA, etc.
|
||||
return 1;
|
||||
|
@ -482,6 +482,7 @@ loaddynimport(char *file, char *pkg, char *p, int n)
|
||||
if(q)
|
||||
*q++ = '\0';
|
||||
s = lookup(name, 0);
|
||||
free(name);
|
||||
if(s->type == 0 || s->type == SXREF) {
|
||||
s->dynimplib = lib;
|
||||
s->dynimpname = def;
|
||||
|
Loading…
Reference in New Issue
Block a user