svn commit: r257435 - head/sys/dev/usb/wlan

Hans Petter Selasky hselasky at FreeBSD.org
Thu Oct 31 11:03:37 UTC 2013


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);
 }
 


More information about the svn-src-head mailing list