[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 08/13 v4] libxl: don't leak ptr in libxl_list_vm error case



Matthew Daley writes ("[PATCH 08/13 v4] libxl: don't leak ptr in libxl_list_vm 
error case"):
> While at it, tidy up the function; there's no point in allocating more
> than the amount of domains actually returned by xc_domain_getinfolist
> (unless 0 domains are returned, in which case we should still allocate
> one libxl_vminfo struct so we can return a non-NULL result and not
> appear to have failed from the caller's perspective.)
...
> +    ptr = calloc(ret ? ret : 1, sizeof(libxl_vminfo));

I think this should be a call to libxl__calloc, which cannot fail.

You still need to prat about with the ?: though I'm afraid.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.