From 1043ce86f8ebd724d267ea9fc7af9a8ff30695a6 Mon Sep 17 00:00:00 2001 From: hoek Date: Sun, 21 May 2000 02:55:09 +0000 Subject: Fix a memory leak in getent() that occurred when the requested entry could not be found. PR: bin/17084 --- lib/libc/gen/getcap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libc/gen/getcap.c') diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index 4e41a79..b3261ae 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -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 -- cgit v1.1