svn commit: r300620 - head/lib/libc/rpc

Ngie Cooper (yaneurabeya) yaneurabeya at gmail.com
Tue May 24 18:54:02 UTC 2016


> On May 24, 2016, at 11:49, Conrad Meyer <cem at FreeBSD.org> wrote:
> 
> On Tue, May 24, 2016 at 11:44 AM, Garrett Cooper <ngie at freebsd.org> wrote:
>> Author: ngie
>> Date: Tue May 24 18:44:50 2016
>> New Revision: 300620
>> URL: https://svnweb.freebsd.org/changeset/base/300620
>> 
>> Log:
>>  Use reallocf instead of malloc to fix leak with outbuf_pmap
>> 
>> ...
>> 
>>  Add a outbuf_pmap = NULL in the failure case to avoid a double-free
>>  at the bottom of the function.
>> 
>> ...
>> Modified: head/lib/libc/rpc/clnt_bcast.c
>> ==============================================================================
>> --- 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 == AF_INET && si.si_proto == IPPROTO_UDP) {
>>                        udpbufsz = fdlist[fdlistno].dsize;
>> -                       if ((outbuf_pmap = malloc(udpbufsz)) == NULL) {
>> +                       outbuf_pmap = reallocf(outbuf_pmap, udpbufsz);
>> +                       if (outbuf_pmap == NULL) {
>> +                               outbuf_pmap = NULL;
> 
> Huh?  This seems a little redundant.

Yes, it was *sigh* (r300621)..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160524/7f63faaf/attachment.sig>


More information about the svn-src-head mailing list