From owner-svn-src-head@freebsd.org Tue May 24 18:54:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66FA7B4995F; Tue, 24 May 2016 18:54:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4371D81; Tue, 24 May 2016 18:54:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x229.google.com with SMTP id 190so18075735iow.1; Tue, 24 May 2016 11:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=wFAVoJvEhBvLDk2m+SJaijq+0g06pBwDw1Czq9NzaiY=; b=OnkNcPa37vJeeQj7ScrffH0GysUmFxk9FJv9IWno3a9vqfWDhqMgSpwuds0siL3Xe7 vE5YA9tVwT1kt/YslbzRxCVJ1viSI6qKQNM0tpUWdmXef84Gr1xYFhhLn7ZMXDzFPMh3 gSoD7Wn3h0sWLN6cOcCYQMdV2FPlwZKwqA0uwajYNKH+SMmqlDRxf619hw3QLcAP5D0t k9KrAHejDXDCQx44eM8Tac8+1juUx4B7cC/BBbDMCnQBpQ/K/MEGOkrlZxUgHeff71Wh VfskYl4iSFYD8V9ctSwW0HQntxNY+X5qpL37Gvw2/yZ8zQx5KgOQmhGvBQDpxC8dubWj NBIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=wFAVoJvEhBvLDk2m+SJaijq+0g06pBwDw1Czq9NzaiY=; b=BfdBB2ttE5tFgDL9PdxwzqNAeJV2aesqEYIDPyqe16VsyTUze0mo1v26xn93/Kd43w lOcL5i3l/xn+9in+GRbbo4235BSJBxBEqkdeR0y5pcz1r/IMfgkdAqRvJ0eIhSAchobi PCqz+EBuuykuCRFNR5Rf+dIjR1I6W5kZbnNKYAZQu8gweR0W4IESVHuTCVTajwCNRpCJ 8QAcmCpQQxNx+0KF6zICYZmytK/X2moBEKVIfgVudBDFcJG/BHXR3kSQc+pbRBOJJJOv s1jd8mVm1uwr+vKvhnyATzclLT8hMpI/4jDDiIVqEqNfloIbdLylTGul6sw/745kQBun QSjg== X-Gm-Message-State: ALyK8tIpEg6So4iP3VCzwWgHFJVlgiQnkosx9bTDlohtM8OWj4MYJVx2psvYo2hJ4nTobA== X-Received: by 10.107.9.86 with SMTP id j83mr338775ioi.50.1464116041564; Tue, 24 May 2016 11:54:01 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id 65sm1503440iog.42.2016.05.24.11.54.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 11:54:00 -0700 (PDT) Subject: Re: svn commit: r300620 - head/lib/libc/rpc Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 24 May 2016 11:53:58 -0700 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <04B24CA6-4C03-4DA9-A18F-8E82BADD0BB3@gmail.com> References: <201605241844.u4OIioBp090457@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 18:54:02 -0000 --Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 24, 2016, at 11:49, Conrad Meyer wrote: >=20 > On Tue, May 24, 2016 at 11:44 AM, Garrett Cooper = wrote: >> Author: ngie >> Date: Tue May 24 18:44:50 2016 >> New Revision: 300620 >> URL: https://svnweb.freebsd.org/changeset/base/300620 >>=20 >> Log: >> Use reallocf instead of malloc to fix leak with outbuf_pmap >>=20 >> ... >>=20 >> Add a outbuf_pmap =3D NULL in the failure case to avoid a = double-free >> at the bottom of the function. >>=20 >> ... >> Modified: head/lib/libc/rpc/clnt_bcast.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libc/rpc/clnt_bcast.c Tue May 24 17:38:27 2016 = (r300619) >> +++ head/lib/libc/rpc/clnt_bcast.c Tue May 24 18:44:50 2016 = (r300620) >> @@ -346,7 +346,9 @@ rpc_broadcast_exp(rpcprog_t prog, rpcver >> #ifdef PORTMAP >> if (si.si_af =3D=3D AF_INET && si.si_proto =3D=3D = IPPROTO_UDP) { >> udpbufsz =3D fdlist[fdlistno].dsize; >> - if ((outbuf_pmap =3D malloc(udpbufsz)) =3D=3D = NULL) { >> + outbuf_pmap =3D reallocf(outbuf_pmap, = udpbufsz); >> + if (outbuf_pmap =3D=3D NULL) { >> + outbuf_pmap =3D NULL; >=20 > Huh? This seems a little redundant. Yes, it was *sigh* (r300621).. --Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXRKNGAAoJEPWDqSZpMIYVYvsP/1jQcrWAkjCIYrh89WwlYTAf 2Ag5Gmj2qAzZFtJ4wwxqBSXA9VgcPgjECZ//lK/LVzIpRU+euwaHwhlNWaf0B8IF GF7+dhobXoiIejx5MXvs2/ogVRa4Tauiz+DF4ISiT141kR7Fkm+AxPogpTQta4Lu BIOAYpM0/Rh9asyayL2EVX/Y5x+8M1TMjMS6/yawCBDKRXWm6QqjD1bGGw3ePFgd r7syi3o2Z6pmIZNxtVHz6hqi13x0NJG/u2JwFbmrWn/qmJpuwe6Uqsa1GuZvtU7e wKUO5kJLdIBVnVJv3A4y0LzQBoCGKoMc4b/vjcR8ALi2u1u7kWcpKbYU9H30FpDN McavFeTYtAP1WLseGvA3NzLpqbKq2H8gYC2hEdcWZlovKNt5eTNYfyUOYivqssYU hGL7dveG+Xh6Fhc9V2vrE9h4DaDtcIeplXNDoPb8/ybsH03M70GcDbXOCwb8t8bn zCokitju9VwfoH2dbu1IqtBeJuh2ZuRopSF4wS6LHTFXqsYYcfYhg5x/xCIjM9Vm oVubxazu9m1noDdBNOmrvNS731lS8izt9SY/Q2k2mWWVlZGS6IO9mCGv0aNXOlPL sSpLI00Gn+REgDVIjzoIROmc7QfAu/Zy8Eao0+F1c1YU2fScv7YqfQVXjhnl3oua 28oQklJ1s0uSLqIj5SqS =GwEY -----END PGP SIGNATURE----- --Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA--