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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to