]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: Use g_auto() for virHashTable in hypervCreateEmbeddedParam
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 19 Oct 2020 09:55:30 +0000 (11:55 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Oct 2020 10:09:12 +0000 (12:09 +0200)
This will allow us to drop 'error' label later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/hyperv/hyperv_wmi.c

index 742a46bc284f3e896966c3aff60462dc5c14a34a..2faa2f396fd9cc1f8033274e3748a3761d0337d7 100644 (file)
@@ -318,7 +318,7 @@ hypervCreateEmbeddedParam(hypervPrivate *priv, hypervWmiClassInfoListPtr info)
 {
     size_t i;
     int count = 0;
-    virHashTablePtr table = NULL;
+    g_autoptr(virHashTable) table = NULL;
     XmlSerializerInfo *typeinfo = NULL;
     XmlSerializerInfo *item = NULL;
     hypervWmiClassInfoPtr classInfo = NULL;
@@ -344,10 +344,9 @@ hypervCreateEmbeddedParam(hypervPrivate *priv, hypervWmiClassInfoListPtr info)
             goto error;
     }
 
-    return table;
+    return g_steal_pointer(&table);
 
  error:
-    virHashFree(table);
     return NULL;
 }