Re: [PATCH 3/5] Avoid deleting NULL veth device name

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

 



On 10/02/2013 05:31 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> If veth device allocation has a fatal error, the veths
> array may contain NULL device names. Avoid calling the
> virNetDevVethDelete function on such names.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/lxc/lxc_process.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK.

> 
> diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
> index a78784e..d07ff13 100644
> --- a/src/lxc/lxc_process.c
> +++ b/src/lxc/lxc_process.c
> @@ -1290,7 +1290,7 @@ cleanup:
>          rc = -1;
>      }
>      for (i = 0; i < nveths; i++) {
> -        if (rc != 0)
> +        if (rc != 0 && veths[i])
>              ignore_value(virNetDevVethDelete(veths[i]));
>          VIR_FREE(veths[i]);
>      }
> 

-- 
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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]