From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 10/28] libxl: only free cpupoolinfo if necessary in libxl_list_cpupool Date: Wed, 18 Sep 2013 10:06:56 +0200 Message-ID: <1379491616.18543.46.camel@Abyss> References: <1379475484-25993-1-git-send-email-mattjd@gmail.com> <1379475484-25993-11-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0200683759343607326==" Return-path: In-Reply-To: <1379475484-25993-11-git-send-email-mattjd@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matthew Daley Cc: Juergen Gross , Stefano Stabellini , Ian Jackson , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============0200683759343607326== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-6+Kn51TaN4iWxDNA+smQ" --=-6+Kn51TaN4iWxDNA+smQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable [Adding Juergen] On mer, 2013-09-18 at 15:37 +1200, Matthew Daley wrote: > Coverity-ID: 1055291 > Signed-off-by: Matthew Daley > --- > tools/libxl/libxl.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index ca24ca3..eeaaee8 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -650,7 +650,8 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx= , int *nb_pool_out) > tmp =3D realloc(ptr, (i + 1) * sizeof(libxl_cpupoolinfo)); > if (!tmp) { > LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool = info"); > - libxl_cpupoolinfo_list_free(ptr, i); > + if (ptr) > + libxl_cpupoolinfo_list_free(ptr, i); > I'm less confident about libxl_cpupoolinfo_list_* than about topology and numa info handling via libxl, but I suspect this is something similar to what I just said in my reply to 12/28 ("libxl: only free cputopology if it was allocated in libxl__get_numa_candidate"). That is to say, this does not look necessary to me, as libxl_cpupoolinfo_list_free() seems to cope well with a non-allocated prt, and making it like this deviates from the usual libxl exit pattern/error handling style. Thoughts? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-6+Kn51TaN4iWxDNA+smQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iEYEABECAAYFAlI5XyAACgkQk4XaBE3IOsR4DACfX2//TbzOh3YUwvk8R3r1cuaK UUMAn0DMyyx69knyBgnJZzkITi64+up6 =aq2g -----END PGP SIGNATURE----- --=-6+Kn51TaN4iWxDNA+smQ-- --===============0200683759343607326== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============0200683759343607326==--