render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
43fe83
From d6fe3f01e405113c9ff5ada2d75e62530608d353 Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <d6fe3f01e405113c9ff5ada2d75e62530608d353.1381871411.git.jdenemar@redhat.com>
43fe83
From: "Daniel P. Berrange" <berrange@redhat.com>
43fe83
Date: Mon, 7 Oct 2013 17:17:29 +0100
43fe83
Subject: [PATCH] Avoid deleting NULL veth device name
43fe83
43fe83
For
43fe83
43fe83
  https://bugzilla.redhat.com/show_bug.cgi?id=1014604
43fe83
43fe83
If veth device allocation has a fatal error, the veths
43fe83
array may contain NULL device names. Avoid calling the
43fe83
virNetDevVethDelete function on such names.
43fe83
43fe83
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
43fe83
(cherry picked from commit 8766e9b5a56109155b5c952af91d384d7e0555ec)
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 src/lxc/lxc_process.c | 2 +-
43fe83
 1 file changed, 1 insertion(+), 1 deletion(-)
43fe83
43fe83
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
43fe83
index bc9bdfb..47e6dd7 100644
43fe83
--- a/src/lxc/lxc_process.c
43fe83
+++ b/src/lxc/lxc_process.c
43fe83
@@ -1280,7 +1280,7 @@ cleanup:
43fe83
         rc = -1;
43fe83
     }
43fe83
     for (i = 0; i < nveths; i++) {
43fe83
-        if (rc != 0)
43fe83
+        if (rc != 0 && veths[i])
43fe83
             ignore_value(virNetDevVethDelete(veths[i]));
43fe83
         VIR_FREE(veths[i]);
43fe83
     }
43fe83
-- 
43fe83
1.8.3.2
43fe83