From 9758561d33f2126a5f3a8180ab73b224a6887c34 Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Thu, 18 Nov 2021 16:58:00 +0000 Subject: 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); } -- cgit v1.2.3