From e8f5a0631a1b55f1bfcdb1a456326fefba7befbb Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Wed, 22 Jan 2014 09:58:29 +0000 Subject: fix a leak in getgrouplist() problem reproduced and fix verified by schwarze who wrote the code ok krw@ deraadt@ schwarze@ --- lib/libc/gen/getgrouplist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index 237abec4eeb..37d321bdb45 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getgrouplist.c,v 1.22 2013/04/17 17:40:35 tedu Exp $ */ +/* $OpenBSD: getgrouplist.c,v 1.23 2014/01/22 09:58:28 jsg Exp $ */ /* * Copyright (c) 2008 Ingo Schwarze * Copyright (c) 1991, 1993 @@ -215,6 +215,7 @@ getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt) ret = -1; /* FALLTHROUGH */ case 1: + free(key); goto out; default: break; -- cgit v1.2.3