diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2003-05-07 21:52:14 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2003-05-07 21:52:14 +0000 |
commit | a1ec18de9fe2333d0d92c76ab5d91e7e9c54e8ed (patch) | |
tree | 51761293e858a9bc361e1671862f52054746b3a7 /gnu | |
parent | 62fb0764f41dadae84b1ac96bbdeef9209bc5e8b (diff) |
fix a memleak
ok deraadt
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/ld/lib.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c index ad0d5762630..cbd41719949 100644 --- a/gnu/usr.bin/ld/lib.c +++ b/gnu/usr.bin/ld/lib.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: lib.c,v 1.11 2002/11/27 00:37:53 espie Exp $ - library routines*/ +/* * $OpenBSD: lib.c,v 1.12 2003/05/07 21:52:13 vincent Exp $ - library routines*/ /* */ @@ -825,8 +825,11 @@ findlib(struct file_entry *p) dot_a: p->flags &= ~E_SEARCH_DYNAMIC; if (cp = strrchr(p->filename, '/')) { + char *tmp; *cp++ = '\0'; - fname = concat(concat(p->filename, "/lib", cp), ".a", ""); + tmp = concat(p->filename, "/lib", cp); + fname = concat(tmp, ".a", ""); + free(tmp); *(--cp) = '/'; } else fname = concat("lib", p->filename, ".a"); |