From a6e3a783162862577f86ebf8875c6384c35807f7 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 18 Nov 2021 16:57:59 +0000 Subject: [PATCH] vndsetcred: don't a reference to credentials in error path. ok deraadt --- sys/dev/vnd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index e08935d0376..94b0da08743 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnd.c,v 1.172 2021/10/09 14:47:02 deraadt Exp $ */ +/* $OpenBSD: vnd.c,v 1.173 2021/11/18 16:57:59 tb Exp $ */ /* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */ /* @@ -677,6 +677,8 @@ vndsetcred(struct proc *p, struct vnode *vp, struct vnd_ioctl *vio, free(buf, M_TEMP, DEV_BSIZE); if (error == 0) *newcredp = new; + else + crfree(new); return (error); } -- 2.20.1