Source-Changes-HG archive

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

[src/trunk]: src/sys/net/npf Don't forget to destroy the mutex before freeing...



details:   https://anonhg.NetBSD.org/src/rev/538d76a8ff90
branches:  trunk
changeset: 805375:538d76a8ff90
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Dec 30 19:11:44 2014 +0000

description:
Don't forget to destroy the mutex before freeing the nat struct on a failed
load.
XXX: pullup -7

diffstat:

 sys/net/npf/npf_nat.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 6c3294b8d1e4 -r 538d76a8ff90 sys/net/npf/npf_nat.c
--- a/sys/net/npf/npf_nat.c     Tue Dec 30 19:11:05 2014 +0000
+++ b/sys/net/npf/npf_nat.c     Tue Dec 30 19:11:44 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_nat.c,v 1.38 2014/12/20 16:19:43 rmind Exp $       */
+/*     $NetBSD: npf_nat.c,v 1.39 2014/12/30 19:11:44 christos Exp $    */
 
 /*-
  * Copyright (c) 2014 Mindaugas Rasiukevicius <rmind at netbsd org>
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_nat.c,v 1.38 2014/12/20 16:19:43 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_nat.c,v 1.39 2014/12/30 19:11:44 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -256,6 +256,7 @@
        }
        return np;
 err:
+       mutex_destroy(&np->n_lock);
        kmem_free(np, sizeof(npf_natpolicy_t));
        return NULL;
 }



Home | Main Index | Thread Index | Old Index