{
virDomainPtr domain = NULL;
hypervPrivate *priv = conn->privateData;
- Msvm_ComputerSystem *computerSystem = NULL;
+ g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
if (hypervGetVirtualSystemByName(priv, name, &computerSystem) < 0)
- goto cleanup;
+ return NULL;
if (computerSystem->next) {
virReportError(VIR_ERR_MULTIPLE_DOMAINS,
_("Multiple domains exist with the name '%s': repeat the request using a UUID"),
name);
- goto cleanup;
+ return NULL;
}
hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain);
- cleanup:
- hypervFreeObject((hypervObject *)computerSystem);
-
return domain;
}