[libvirt] [PATCH] esx: Fix a potential crash

Osier Yang jyang at redhat.com
Tue Jul 12 09:05:16 UTC 2011


Initialize ptr data.datastorePathWithoutFileName as NULL, otherwise
it might cause crash when trying to free it in cleanup.

---
 src/esx/esx_driver.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index ddb8c23..ae614a6 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2698,6 +2698,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
     char *vmx = NULL;
     virVMXContext ctx;
     esxVMX_Data data;
+    data.datastorePathWithoutFileName = NULL;
     virDomainDefPtr def = NULL;
     char *xml = NULL;
 
-- 
1.7.6




More information about the libvir-list mailing list