On 02/20/2014 02:29 AM, Jincheng Miao wrote:
> When start a guest with --pass-fd, if the argument of --pass-fd is invalid,
> virsh will exit, but doesn't free the variable 'dom'.
> 

> +++ b/tools/virsh-domain.c
> @@ -3428,11 +3428,11 @@ cmdStart(vshControl *ctl, const vshCmd *cmd)
>      if (virDomainGetID(dom) != (unsigned int)-1) {
>          vshError(ctl, "%s", _("Domain is already active"));
>          virDomainFree(dom);
> -        return false;
> +        goto cleanup;
>      }

As is, this change ends up with a double-free calling virDomainFree(dom)
twice.  Delete the one here, and let the cleanup label handle it instead.

>  
>      if (cmdStartGetFDs(ctl, cmd, &nfds, &fds) < 0)
> -        return false;
> +        goto cleanup;

at which point this is also correct.  I'll push the amended patch shortly.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to