From owner-svn-src-all@FreeBSD.ORG Wed Apr 13 00:03:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E31D6106566C; Wed, 13 Apr 2011 00:03:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2E338FC14; Wed, 13 Apr 2011 00:03:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3D03nq2039529; Wed, 13 Apr 2011 00:03:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3D03nPn039526; Wed, 13 Apr 2011 00:03:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104130003.p3D03nPn039526@svn.freebsd.org> From: Rick Macklem Date: Wed, 13 Apr 2011 00:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220585 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 00:03:50 -0000 Author: rmacklem Date: Wed Apr 13 00:03:49 2011 New Revision: 220585 URL: http://svn.freebsd.org/changeset/base/220585 Log: Fix a couple of mbuf leaks introduced by r217242. I do not believe that these leaks had a practical impact, since the situations in which they would have occurred would have been extremely rare. MFC after: 2 weeks Modified: head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Tue Apr 12 23:49:07 2011 (r220584) +++ head/sys/rpc/clnt_dg.c Wed Apr 13 00:03:49 2011 (r220585) @@ -1086,11 +1086,13 @@ clnt_dg_soupcall(struct socket *so, void /* * The XID is in the first uint32_t of the reply. */ - if (m->m_len < sizeof(xid) && m_length(m, NULL) < sizeof(xid)) + if (m->m_len < sizeof(xid) && m_length(m, NULL) < sizeof(xid)) { /* * Should never happen. */ + m_freem(m); continue; + } m_copydata(m, 0, sizeof(xid), (char *)&xid); xid = ntohl(xid); Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Tue Apr 12 23:49:07 2011 (r220584) +++ head/sys/rpc/clnt_vc.c Wed Apr 13 00:03:49 2011 (r220585) @@ -973,8 +973,11 @@ clnt_vc_soupcall(struct socket *so, void * the reply. */ if (ct->ct_record->m_len < sizeof(xid) && - m_length(ct->ct_record, NULL) < sizeof(xid)) + m_length(ct->ct_record, NULL) < + sizeof(xid)) { + m_freem(ct->ct_record); break; + } m_copydata(ct->ct_record, 0, sizeof(xid), (char *)&xid); xid = ntohl(xid);