esx: Fix segfault in esxConnectToHost

Caused by commit 4445e16bfa that
made the code used the connection private data pointer before
it was initialized.
This commit is contained in:
Ryan Woodsmall 2012-04-21 14:13:02 +02:00 committed by Matthias Bolte
parent 995b5b3d7c
commit b126715a48
2 changed files with 3 additions and 2 deletions

View File

@ -232,6 +232,7 @@ Patches have also been contributed by:
Stefan Bader <stefan.bader@canonical.com>
MATSUDA Daiki <matsudadik@intellilink.co.jp>
Jan Kiszka <jan.kiszka@siemens.com>
Ryan Woodsmall <rwoodsmall@gmail.com>
[....send patches to get your name here....]

View File

@ -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: