Source-Changes-HG archive

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

[src/trunk]: src/sys/net Memory leak, found by brainy; not tested, but obviou...



details:   https://anonhg.NetBSD.org/src/rev/8dca5314410a
branches:  trunk
changeset: 817269:8dca5314410a
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Aug 15 09:14:12 2016 +0000

description:
Memory leak, found by brainy; not tested, but obvious enough

diffstat:

 sys/net/if_ieee1394subr.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 5ed37d7aeaba -r 8dca5314410a sys/net/if_ieee1394subr.c
--- a/sys/net/if_ieee1394subr.c Mon Aug 15 09:06:39 2016 +0000
+++ b/sys/net/if_ieee1394subr.c Mon Aug 15 09:14:12 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ieee1394subr.c,v 1.56 2016/06/22 10:44:32 knakahara Exp $   */
+/*     $NetBSD: if_ieee1394subr.c,v 1.57 2016/08/15 09:14:12 maxv Exp $        */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.56 2016/06/22 10:44:32 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.57 2016/08/15 09:14:12 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -288,8 +288,10 @@
                ifh->ifh_dgl = htons(ic->ic_dgl);
                ifh->ifh_reserved = 0;
                m->m_next = m_copy(m0, sizeof(*ifh) + off, fraglen);
-               if (m->m_next == NULL)
+               if (m->m_next == NULL) {
+                       m_freem(m);
                        goto bad;
+               }
                m->m_pkthdr.len = sizeof(*ifh) + fraglen;
                off += fraglen;
                *mp = m;



Home | Main Index | Thread Index | Old Index