summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-01 04:35:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-01 04:35:34 +0000
commitea8ffe2bb5c8cad389bbc90b3a3165cb297d5175 (patch)
tree4b8eef40a26a65ec60f21dbb3fa1d347687a2e23 /lib
parent0564e6a88faf84ff128ecc665e94ac688b9b88b5 (diff)
mem leak, from lidl@va.pubnix.com
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getcap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index 332af9697ec..8643d6483f7 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getcap.c,v 1.3 1996/09/15 09:31:00 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getcap.c,v 1.4 1997/02/01 04:35:33 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -241,7 +241,7 @@ getent(cap, len, db_array, fd, name, depth, nfield)
*/
if (fd >= 0) {
- (void)lseek(fd, (off_t)0, L_SET);
+ (void)lseek(fd, (off_t)0, SEEK_SET);
myfd = 0;
} else {
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p);
@@ -382,8 +382,10 @@ getent(cap, len, db_array, fd, name, depth, nfield)
break;
}
- if (!foundit)
+ if (!foundit) {
+ free(record);
return (-1);
+ }
/*
* Got the capability record, but now we have to expand all tc=name