From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcnI8-0003iH-70 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 23:24:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcnI3-00062Y-Rt for qemu-devel@nongnu.org; Fri, 10 Oct 2014 23:24:24 -0400 Message-ID: <5438A2C8.80508@redhat.com> Date: Fri, 10 Oct 2014 21:23:52 -0600 From: Eric Blake MIME-Version: 1.0 References: <1412996048-6384-1-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1412996048-6384-1-git-send-email-arei.gonglei@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="smi24EXxmAp9TN8o92384g9kKK8PqvLnc" Subject: Re: [Qemu-devel] [PATCH] oslib-posix: change free to g_free List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-trivial@nongnu.org, weidong.huang@huawei.com, stefanha@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --smi24EXxmAp9TN8o92384g9kKK8PqvLnc Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/10/2014 08:54 PM, arei.gonglei@huawei.com wrote: > From: Gonglei >=20 > The caller of qemu_vfree() maybe not check whether parameter > ptr pointer is NULL or not, such as vpc_open(). > Using g_free() is more safe. NACK. g_free is only safe for pointers allocated by g_malloc. qemu_vfree is for use on pointers allocated by qemu_try_memalign and friends (matching the name valloc which is an older spelling of posix_memalign), which are NOT allocated by g_malloc. Furthermore, free(NULL) is safe. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --smi24EXxmAp9TN8o92384g9kKK8PqvLnc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUOKLIAAoJEKeha0olJ0Nq/dwH/2nVWoQQ/4Jq9NlSb1OOio+v tS/neUDLrFM8fjGj2t865MCZveVWPTK3/YqCZ0I5KaYQHsXRfFiwzMC01MUiZaKi DSE4/ZCwZjxo8HptySmmd4tCB2mX+M4UbudQbMoywzcBM6XoG/3dDniBOZj1rtYl o2eOpL0SaeUE/oi4VR3bG8RkM0Tk/5YdL0IZk3UGHYIVBmSET04WbSP7DAxuRb6k NSOIQB6NAW6plaEEfegew6e8V5T6EeuehGrH5b5UAu4oeszlzcZcgYd7AfnRoA1O hBrXB85tigoNth8Fkv5okUCa2tMxphNFlH4hWy8LSfgs5tbD8zGFTofWyg/t+jU= =Iwkp -----END PGP SIGNATURE----- --smi24EXxmAp9TN8o92384g9kKK8PqvLnc--