From 0b090b91ac9cd35a57c3bd77226e0e2a1ebd2dfe Mon Sep 17 00:00:00 2001 From: brueffer Date: Sat, 22 Oct 2011 18:20:12 +0000 Subject: [PATCH] MFC: r226247, r226253 Properly free linux_gidset in case of an error. Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/stable/9@226640 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/compat/linux/linux_uid16.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index 708cad123..31950ffb2 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -113,8 +113,10 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); - if (error) + if (error) { + free(linux_gidset, M_TEMP); return (error); + } newcred = crget(); p = td->td_proc; PROC_LOCK(p); -- 2.45.0