From: Ryan Woodsmall Date: Sat, 21 Apr 2012 12:13:02 +0000 (+0200) Subject: esx: Fix segfault in esxConnectToHost X-Git-Tag: v0.9.12-rc1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b126715a48cd0cbe32ec6468c267cd8cf2961c55;p=thirdparty%2Flibvirt.git esx: Fix segfault in esxConnectToHost Caused by commit 4445e16bfa8056980ac643fabf17186f9e685925 that made the code used the connection private data pointer before it was initialized. --- diff --git a/AUTHORS b/AUTHORS index eee4998cb8..20e1b4bd30 100644 --- a/AUTHORS +++ b/AUTHORS @@ -232,6 +232,7 @@ Patches have also been contributed by: Stefan Bader MATSUDA Daiki Jan Kiszka + Ryan Woodsmall [....send patches to get your name here....] diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index dff8aa672e..d9f53f7418 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -1023,6 +1023,8 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, priv->supportsLongMode = esxVI_Boolean_Undefined; priv->usedCpuTimeCounterId = -1; + conn->privateData = priv; + /* * Set the port dependent on the transport protocol if no port is * specified. This allows us to rely on the port parameter being @@ -1114,8 +1116,6 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, goto cleanup; } - conn->privateData = priv; - result = VIR_DRV_OPEN_SUCCESS; cleanup: