[libvirt] [PATCH] Fix uninitialized variable in virLXCControllerSetupDevPTS

Daniel P. Berrange berrange at redhat.com
Wed Nov 14 15:40:51 UTC 2012


From: "Daniel P. Berrange" <berrange at redhat.com>

The lack of initialization of 'opts' caused a SEGV in the
cleanup: path if the root->src directory did not exist

Pushed under trivial rule

---
 src/lxc/lxc_controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index a41c903..2f1e8a5 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -1144,7 +1144,7 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
 {
     virDomainFSDefPtr root = virDomainGetRootFilesystem(ctrl->def);
     char *mount_options = NULL;
-    char *opts;
+    char *opts = NULL;
     char *devpts = NULL;
     int ret = -1;
 
-- 
1.7.11.7




More information about the libvir-list mailing list