API: Init conn in case of it might be used uninitialized

There is a goto before "conn" is initialized.
This commit is contained in:
Osier Yang 2011-09-02 12:49:24 +08:00
parent 55d88def95
commit 50c82157e1

View File

@ -15225,12 +15225,13 @@ virDomainMigrateGetMaxSpeed(virDomainPtr domain,
return -1;
}
conn = domain->conn;
if (!bandwidth) {
virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
goto error;
}
conn = domain->conn;
if (conn->flags & VIR_CONNECT_RO) {
virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
goto error;