Module Name: src
Committed By: snj
Date: Tue Nov 1 20:08:15 UTC 2016
Modified Files:
src/sys/kern [netbsd-7]: uipc_usrreq.c
Log Message:
Pull up following revision(s) (requested by maxv in ticket #1268):
sys/kern/uipc_usrreq.c: revision 1.181
Memory leak, found by Mootja. It is easily triggerable from userland.
To generate a diff of this commit:
cvs rdiff -u -r1.169.2.3 -r1.169.2.4 src/sys/kern/uipc_usrreq.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.169.2.3 src/sys/kern/uipc_usrreq.c:1.169.2.4
--- src/sys/kern/uipc_usrreq.c:1.169.2.3 Tue Apr 14 04:44:41 2015
+++ src/sys/kern/uipc_usrreq.c Tue Nov 1 20:08:15 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_usrreq.c,v 1.169.2.3 2015/04/14 04:44:41 snj Exp $ */
+/* $NetBSD: uipc_usrreq.c,v 1.169.2.4 2016/11/01 20:08:15 snj Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.169.2.3 2015/04/14 04:44:41 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.169.2.4 2016/11/01 20:08:15 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1173,11 +1173,11 @@ unp_connect(struct socket *so, struct mb
goto bad2;
}
vp = nd.ni_vp;
+ pathbuf_destroy(pb);
if (vp->v_type != VSOCK) {
error = ENOTSOCK;
goto bad;
}
- pathbuf_destroy(pb);
if ((error = VOP_ACCESS(vp, VWRITE, l->l_cred)) != 0)
goto bad;
/* Acquire v_interlock to protect against unp_detach(). */