Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Memory leak, found by Mootja. It is easily triggera...



details:   https://anonhg.NetBSD.org/src/rev/4865e66fba6f
branches:  trunk
changeset: 348638:4865e66fba6f
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Oct 31 15:05:05 2016 +0000

description:
Memory leak, found by Mootja. It is easily triggerable from userland.

diffstat:

 sys/kern/uipc_usrreq.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 79562a9d145b -r 4865e66fba6f sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c    Mon Oct 31 14:34:32 2016 +0000
+++ b/sys/kern/uipc_usrreq.c    Mon Oct 31 15:05:05 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_usrreq.c,v 1.180 2016/04/06 19:45:45 roy Exp $    */
+/*     $NetBSD: uipc_usrreq.c,v 1.181 2016/10/31 15:05:05 maxv 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.180 2016/04/06 19:45:45 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.181 2016/10/31 15:05:05 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1151,11 +1151,11 @@
                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(). */



Home | Main Index | Thread Index | Old Index