Author: tuexen
Date: Sun Sep 30 21:31:33 2018
New Revision: 339027
URL: https://svnweb.freebsd.org/changeset/base/339027

Log:
  Plug mbuf leaks in the SCTP output path in error cases.
  
  Approved by:            re (kib@)
  MFC after:              1 week
  CID:                  1395307

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c      Sun Sep 30 21:23:31 2018        
(r339026)
+++ head/sys/netinet/sctp_output.c      Sun Sep 30 21:31:33 2018        
(r339027)
@@ -4367,6 +4367,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
                        /* KAME hack: embed scopeid */
                        if (sa6_embedscope(sin6, 
MODULE_GLOBAL(ip6_use_defzone)) != 0) {
                                SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, 
SCTP_FROM_SCTP_OUTPUT, EINVAL);
+                               sctp_m_freem(m);
                                return (EINVAL);
                        }
                        if (net == NULL) {
@@ -4431,6 +4432,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
                                        /* KAME hack: embed scopeid */
                                        if (sa6_embedscope(sin6, 
MODULE_GLOBAL(ip6_use_defzone)) != 0) {
                                                SCTP_LTRACE_ERR_RET_PKT(m, inp, 
stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
+                                               sctp_m_freem(m);
                                                return (EINVAL);
                                        }
                                        /* Cache the source address */
@@ -4457,6 +4459,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
                                /* KAME hack: embed scopeid */
                                if (sa6_embedscope(sin6, 
MODULE_GLOBAL(ip6_use_defzone)) != 0) {
                                        SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, 
net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
+                                       sctp_m_freem(m);
                                        return (EINVAL);
                                }
                                if (over_addr == NULL) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to