[libvirt] [PATCH 2/6] vmware: Avoid NULL dereference for 'caps'
Daniel P. Berrange
berrange at redhat.com
Mon Jan 7 18:26:20 UTC 2013
On Mon, Jan 07, 2013 at 12:09:30PM -0500, John Ferlan wrote:
> When virCapabilitiesNew() fails, caps will be NULL resulting in possible
> core when deref'd in cpuDataFree() call.
> ---
> src/vmware/vmware_conf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
> index b514636..fd9c473 100644
> --- a/src/vmware/vmware_conf.c
> +++ b/src/vmware/vmware_conf.c
> @@ -127,7 +127,8 @@ vmwareCapsInit(void)
>
> cleanup:
> virCPUDefFree(cpu);
> - cpuDataFree(caps->host.arch, data);
> + if (caps)
> + cpuDataFree(caps->host.arch, data);
>
> return caps;
ACK
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list