From: Daniel P. Berrange Date: Wed, 2 Oct 2013 10:26:59 +0000 (+0100) Subject: Avoid deleting NULL veth device name X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8766e9b5a56109155b5c952af91d384d7e0555ec;p=libvirt.git Avoid deleting NULL veth device name 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 --- diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index a78784e5c1..d07ff13a03 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]); }