diff options
author | 2003-05-07 21:52:13 +0000 | |
---|---|---|
committer | 2003-05-07 21:52:13 +0000 | |
commit | 4bcdbf2ffaeffe4956380998ab8ab2ea9b2ec9f1 (patch) | |
tree | 561822d6f0be434743a35432e345e61aa4d3db0e | |
parent | double semicolon in local var decl (diff) | |
download | wireguard-openbsd-4bcdbf2ffaeffe4956380998ab8ab2ea9b2ec9f1.tar.xz wireguard-openbsd-4bcdbf2ffaeffe4956380998ab8ab2ea9b2ec9f1.zip |
fix a memleak
ok deraadt
-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"); |