Resolve two Coverity issues introduced by commit id '9b8d6e1e'
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/libxl/libxl_migration.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 9fe904e..a25edf0 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -98,8 +98,7 @@ libxlDoMigrateReceive(virNetSocketPtr sock,
size_t i;
int ret;
- virNetSocketAccept(sock, &client_sock);
- if (client_sock == NULL) {
+ if (virNetSocketAccept(sock, &client_sock) < 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Fail to accept migration connection"));
goto cleanup;
@@ -526,8 +525,7 @@ libxlDomainMigrationFinish(virConnectPtr dconn,
cleanup:
if (event)
libxlDomainEventQueue(driver, event);
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
virObjectUnref(cfg);
return dom;
}
--
1.9.3