Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tools/virt-host-validate-common.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
index aba1bdf6cf..647ed7b48b 100644
--- a/tools/virt-host-validate-common.c
+++ b/tools/virt-host-validate-common.c
@@ -330,7 +330,7 @@ int virHostValidateCGroupControllers(const char *hvname
G_GNUC_UNUSED,
int virHostValidateIOMMU(const char *hvname,
virHostValidateLevel level)
{
- virBitmap *flags;
+ g_autoptr(virBitmap) flags = NULL;
struct stat sb;
const char *bootarg = NULL;
bool isAMD = false, isIntel = false;
@@ -347,8 +347,6 @@ int virHostValidateIOMMU(const char *hvname,
else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM))
isAMD = true;
- virBitmapFree(flags);
-
if (isIntel) {
if (access("/sys/firmware/acpi/tables/DMAR", F_OK) == 0) {
virHostMsgPass();
@@ -445,7 +443,7 @@ bool virHostKernelModuleIsLoaded(const char *module)
int virHostValidateSecureGuests(const char *hvname,
virHostValidateLevel level)
{
- virBitmap *flags;
+ g_autoptr(virBitmap) flags = NULL;
bool hasFac158 = false;
bool hasAMDSev = false;
virArch arch = virArchFromHost();
@@ -460,8 +458,6 @@ int virHostValidateSecureGuests(const char *hvname,
else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SEV))
hasAMDSev = true;
- virBitmapFree(flags);
-
virHostMsgCheck(hvname, "%s", _("for secure guest support"));
if (ARCH_IS_S390(arch)) {
if (hasFac158) {
--
2.31.1