Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 May 2016 11:53:58 -0700
From:      "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To:        "Conrad E. Meyer" <cem@FreeBSD.org>
Cc:        Garrett Cooper <ngie@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r300620 - head/lib/libc/rpc
Message-ID:  <04B24CA6-4C03-4DA9-A18F-8E82BADD0BB3@gmail.com>
In-Reply-To: <CAG6CVpUYMpc_Bj4cnNVqi9Yoaq0PTowjmM6brpeV8ZjrsHbe2w@mail.gmail.com>
References:  <201605241844.u4OIioBp090457@repo.freebsd.org> <CAG6CVpUYMpc_Bj4cnNVqi9Yoaq0PTowjmM6brpeV8ZjrsHbe2w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <cem@FreeBSD.org> wrote:
>=20
> On Tue, May 24, 2016 at 11:44 AM, Garrett Cooper <ngie@freebsd.org> =
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?04B24CA6-4C03-4DA9-A18F-8E82BADD0BB3>