mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
virDomainDeviceValidateAliasImpl: Automatically free GHashTable and remove cleanup
After the conversion to g_autofree, the cleanup label is no longer needed. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
a977173aa6
commit
35ebb28f3f
@ -1360,28 +1360,23 @@ static int
|
||||
virDomainDeviceValidateAliasImpl(const virDomainDef *def,
|
||||
virDomainDeviceDef *dev)
|
||||
{
|
||||
GHashTable *aliases = NULL;
|
||||
g_autoptr(GHashTable) aliases = NULL;
|
||||
virDomainDeviceInfo *info = virDomainDeviceGetInfo(dev);
|
||||
int ret = -1;
|
||||
|
||||
if (!info || !info->alias)
|
||||
return 0;
|
||||
|
||||
if (virDomainDefValidateAliases(def, &aliases) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (virHashLookup(aliases, info->alias)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("non unique alias detected: %s"),
|
||||
info->alias);
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
|
||||
virHashFree(aliases);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user