[libvirt] [PATCH]: don't crash when calling libvirt_lxc without arguments

Daniel P. Berrange berrange at redhat.com
Tue May 5 09:37:49 UTC 2009


On Mon, May 04, 2009 at 09:39:04PM +0200, Guido G?nther wrote:
> In this case we reference def with is NULL. O.k. to apply?
> Cheers,

ACK, but what code would call libvirt_lx without args ?


> >From ff82eb24e50b4f80769bd932ca739e8a2539edb4 Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
> Date: Mon, 4 May 2009 21:29:15 +0200
> Subject: [PATCH 1/2] don't crash with def == NULL
> 
> happens when calling libvirt_lxc without arguments
> ---
>  src/lxc_controller.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/lxc_controller.c b/src/lxc_controller.c
> index 3f9add2..e0fb05d 100644
> --- a/src/lxc_controller.c
> +++ b/src/lxc_controller.c
> @@ -745,7 +745,8 @@ int main(int argc, char *argv[])
>  
>  
>  cleanup:
> -    virFileDeletePid(LXC_STATE_DIR, def->name);
> +    if (def)
> +        virFileDeletePid(LXC_STATE_DIR, def->name);
>      lxcControllerCleanupInterfaces(nveths, veths);
>      unlink(sockpath);
>      VIR_FREE(sockpath);
> -- 
> 1.6.2.4
> 

> --
> Libvir-list mailing list
> Libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list