Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2013 11:03:37 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257435 - head/sys/dev/usb/wlan
Message-ID:  <201310311103.r9VB3beU048889@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Oct 31 11:03:36 2013
New Revision: 257435
URL: http://svnweb.freebsd.org/changeset/base/257435

Log:
  Fix a potential memory leak.
  
  MFC after:	1 week

Modified:
  head/sys/dev/usb/wlan/if_run.c

Modified: head/sys/dev/usb/wlan/if_run.c
==============================================================================
--- head/sys/dev/usb/wlan/if_run.c	Thu Oct 31 10:15:22 2013	(r257434)
+++ head/sys/dev/usb/wlan/if_run.c	Thu Oct 31 11:03:36 2013	(r257435)
@@ -2676,6 +2676,7 @@ tr_setup:
 			m->m_data += 4;
 			m->m_pkthdr.len = m->m_len -= 4;
 			run_rx_frame(sc, m, dmalen);
+			m = NULL;	/* don't free source buffer */
 			break;
 		}
 
@@ -2697,6 +2698,9 @@ tr_setup:
 		m->m_pkthdr.len = m->m_len -= dmalen + 8;
 	}
 
+	/* make sure we free the source buffer, if any */
+	m_freem(m);
+
 	RUN_LOCK(sc);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310311103.r9VB3beU048889>