diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index cbf08fc8c8027a8f1fe6c1d0ff39b0d6f5d07f08..964a4d7806ba2fab32f8ed04bb1c8e6ebe221679 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3195,7 +3195,8 @@ virDomainMigrateVersion3Full(virDomainPtr domain, orig_err->domain == VIR_FROM_QEMU && orig_err->code == VIR_ERR_OPERATION_FAILED) { virErrorPtr err = virGetLastError(); - if (err->domain == VIR_FROM_QEMU && + if (err && + err->domain == VIR_FROM_QEMU && err->code != VIR_ERR_MIGRATE_FINISH_OK) { virFreeError(orig_err); orig_err = NULL; diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index ff89ab5f1e77907ee70709f0cce90e10712ecc38..d50d3675d7afb41e75fadab9655bec3484079b01 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5023,7 +5023,8 @@ doPeer2PeerMigrate3(virQEMUDriverPtr driver, orig_err->domain == VIR_FROM_QEMU && orig_err->code == VIR_ERR_OPERATION_FAILED) { virErrorPtr err = virGetLastError(); - if (err->domain == VIR_FROM_QEMU && + if (err && + err->domain == VIR_FROM_QEMU && err->code != VIR_ERR_MIGRATE_FINISH_OK) { virFreeError(orig_err); orig_err = NULL;