]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainGetLaunchSecurityInfo: Don't forget unlock VM object on (impossible) error
authorPeter Krempa <pkrempa@redhat.com>
Wed, 26 Feb 2025 15:55:54 +0000 (16:55 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 12 Mar 2025 11:56:58 +0000 (12:56 +0100)
If 'vm->def->sec->sectype' would be invalid; which is currently not
possible; we'd not unlock the domain object. Fix the logic even when the
bug currently can't happen.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c

index 6290e5bb8daeb061747a384036f771c0cf6f2546..51ccd6b8221edf95a4ab9b1414d78c2300ceb09f 100644 (file)
@@ -19152,7 +19152,7 @@ qemuDomainGetLaunchSecurityInfo(virDomainPtr domain,
     case VIR_DOMAIN_LAUNCH_SECURITY_NONE:
     case VIR_DOMAIN_LAUNCH_SECURITY_LAST:
         virReportEnumRangeError(virDomainLaunchSecurity, vm->def->sec->sectype);
-        return -1;
+        goto cleanup;
     }
 
     ret = 0;