]> xenbits.xensource.com Git - libvirt.git/commitdiff
Avoid deleting NULL veth device name
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 2 Oct 2013 10:26:59 +0000 (11:26 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 3 Oct 2013 10:28:08 +0000 (11:28 +0100)
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@redhat.com>
src/lxc/lxc_process.c

index a78784e5c1a18ee0a1afe810aa1d1789140f5860..d07ff13a038abf1d5fc4ef924ddf55b7edf12a15 100644 (file)
@@ -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]);
     }