diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 93f0a01b4e40e360cb80d7ee76ccd2aaa2c8e697..0cddb86b51d72b8241026aa15fdd77f0aa9adfcb 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -903,7 +903,7 @@ qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk) { qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - if (!diskPriv->secinfo) + if (!diskPriv || !diskPriv->secinfo) return; qemuDomainSecretInfoFree(&diskPriv->secinfo); @@ -964,7 +964,7 @@ qemuDomainSecretHostdevDestroy(virDomainHostdevDefPtr hostdev) qemuDomainHostdevPrivatePtr hostdevPriv = QEMU_DOMAIN_HOSTDEV_PRIVATE(hostdev); - if (!hostdevPriv->secinfo) + if (!hostdevPriv || !hostdevPriv->secinfo) return; qemuDomainSecretInfoFree(&hostdevPriv->secinfo);