From: Michal Privoznik Date: Mon, 19 Oct 2020 09:55:30 +0000 (+0200) Subject: hyperv: Use g_auto() for virHashTable in hypervCreateEmbeddedParam X-Git-Tag: v6.9.0-rc1~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28065881f7ee9673fd3ad1c7700cfca8c46117df;p=thirdparty%2Flibvirt.git hyperv: Use g_auto() for virHashTable in hypervCreateEmbeddedParam This will allow us to drop 'error' label later. Signed-off-by: Michal Privoznik --- diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 742a46bc28..2faa2f396f 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -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; }