Module Name:    src
Committed By:   maxv
Date:           Mon Aug 15 09:14:12 UTC 2016

Modified Files:
        src/sys/net: if_ieee1394subr.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/net/if_ieee1394subr.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/net/if_ieee1394subr.c
diff -u src/sys/net/if_ieee1394subr.c:1.56 src/sys/net/if_ieee1394subr.c:1.57
--- src/sys/net/if_ieee1394subr.c:1.56	Wed Jun 22 10:44:32 2016
+++ src/sys/net/if_ieee1394subr.c	Mon Aug 15 09:14:12 2016
@@ -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 @@ ieee1394_fragment(struct ifnet *ifp, str
 		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;

Reply via email to