Date: Tue, 19 Jan 2016 01:30:22 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294300 - stable/10/lib/libc/rpc Message-ID: <201601190130.u0J1UMWg081661@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Tue Jan 19 01:30:22 2016 New Revision: 294300 URL: https://svnweb.freebsd.org/changeset/base/294300 Log: MFC r293715: Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)` This fixes the potential NULL pointer dereference properly, and also fixes memory leaks encountered in the process of iterating through `*rp`. Found by: Valgrind Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Modified: stable/10/lib/libc/rpc/rpcb_prot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpcb_prot.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_prot.c Mon Jan 18 22:21:46 2016 (r294299) +++ stable/10/lib/libc/rpc/rpcb_prot.c Tue Jan 19 01:30:22 2016 (r294300) @@ -217,14 +217,14 @@ xdr_rpcb_entry_list_ptr(xdrs, rp) * the case of freeing we must remember the next object * before we free the current object ... */ - if (freeing) + if (freeing && *rp) next = (*rp)->rpcb_entry_next; if (! xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof (rpcb_entry_list), (xdrproc_t)xdr_rpcb_entry)) { return (FALSE); } - if (freeing && *rp) { + if (freeing) { next_copy = next; rp = &next_copy; /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601190130.u0J1UMWg081661>