Date: Sun, 23 Sep 2012 13:52:20 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Kevin Lo <kevlo@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240850 - head/lib/libstand Message-ID: <20120923105220.GL37286@deviant.kiev.zoral.com.ua> In-Reply-To: <201209230838.q8N8c6Tu056083@svn.freebsd.org> References: <201209230838.q8N8c6Tu056083@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--l/31HQTn6peyh0iH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 23, 2012 at 08:38:06AM +0000, Kevin Lo wrote: > Author: kevlo > Date: Sun Sep 23 08:38:06 2012 > New Revision: 240850 > URL: http://svn.freebsd.org/changeset/base/240850 >=20 > Log: > Avoid NULL dereference >=20 > Modified: > head/lib/libstand/nfs.c >=20 > Modified: head/lib/libstand/nfs.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/libstand/nfs.c Sun Sep 23 07:43:10 2012 (r240849) > +++ head/lib/libstand/nfs.c Sun Sep 23 08:38:06 2012 (r240850) > @@ -1256,8 +1256,10 @@ nfs_open(const char *upath, struct open_ > error =3D 0; > =20 > out: > - free(newfd); > - free(path); > + if (newfd) > + free(newfd); > + if (path) > + free(path); > #else > currfd->iodesc =3D desc; > =20 I do not see how this change is useful. libstand' Free() function handles NULL parameter fine, as well as all other free(3) implementations I am aware of. --l/31HQTn6peyh0iH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlBe6eQACgkQC3+MBN1Mb4hugQCg52Fn6t82hUyiF2758uxHvo8I ODwAmgIE8px9fFG4S+rlBSl/awVotObJ =eZI4 -----END PGP SIGNATURE----- --l/31HQTn6peyh0iH--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120923105220.GL37286>