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

Re: [Xen-devel] [PATCH] libxl: only free vcpu info list when it is allocated



On Fri, Oct 21, 2016 at 07:26:16PM +0200, Dario Faggioli wrote:
> On Fri, 2016-10-21 at 18:17 +0100, Wei Liu wrote:
> > Clang complains nr_dom_vcpus may be used uninitialized after
> > 4a6070ea9.
> > 
> > The real issue is vinfo can be NULL and nr_dom_vcpus remains
> > uninitialized if previous call fails.
> > 
> If it were me doing this, I'd just have initialized nr_dom_vcpus to 0.
> 
> This is what I've always done when using libxl_numainfo_list_free(),
> which is similar to this (then how did I miss doing it here? Oh,
> well... :-/)
> 
> And since we're initializing vinfo to NULL already, initializing
> nr_dom_vcpus as well makes things look more uniform.
> 

Right. I think this is a better idea.

I will send out another version of this patch.

Wei.

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

 


Rackspace

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