qemuDomainGetDiskErrors: Automatically free GHashTable

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:
Peter Krempa 2021-11-30 11:42:17 +01:00
parent c366c9bcdd
commit 9e0995c821
1 changed files with 1 additions and 2 deletions

View File

@ -16423,7 +16423,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
virQEMUDriver *driver = dom->conn->privateData;
virDomainObj *vm = NULL;
qemuDomainObjPrivate *priv;
GHashTable *table = NULL;
g_autoptr(GHashTable) table = NULL;
bool blockdev = false;
int ret = -1;
size_t i;
@ -16484,7 +16484,6 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
virHashFree(table);
if (ret < 0) {
for (i = 0; i < n; i++)
VIR_FREE(errors[i].disk);