Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Dec 2017 14:09:06 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r327061 - stable/11/sys/netinet
Message-ID:  <201712211409.vBLE96BA064071@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Thu Dec 21 14:09:06 2017
New Revision: 327061
URL: https://svnweb.freebsd.org/changeset/base/327061

Log:
  MFC r326847:
    Fix mbuf leak when TCPMD5_OUTPUT() method returns error.
  
    PR:		223817

Modified:
  stable/11/sys/netinet/tcp_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_output.c
==============================================================================
--- stable/11/sys/netinet/tcp_output.c	Thu Dec 21 13:32:49 2017	(r327060)
+++ stable/11/sys/netinet/tcp_output.c	Thu Dec 21 14:09:06 2017	(r327061)
@@ -1275,12 +1275,13 @@ send:
 		 * NOTE: since TCP options buffer doesn't point into
 		 * mbuf's data, calculate offset and use it.
 		 */
-		if (!TCPMD5_ENABLED() || TCPMD5_OUTPUT(m, th,
-		    (u_char *)(th + 1) + (to.to_signature - opt)) != 0) {
+		if (!TCPMD5_ENABLED() || (error = TCPMD5_OUTPUT(m, th,
+		    (u_char *)(th + 1) + (to.to_signature - opt))) != 0) {
 			/*
 			 * Do not send segment if the calculation of MD5
 			 * digest has failed.
 			 */
+			m_freem(m);
 			goto out;
 		}
 	}



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