summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/getcap.c4
1 files changed, 3 insertions, 1 deletions
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
OpenPOWER on IntegriCloud