mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
testQemuGetLatestCaps: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
ac60a87f2b
commit
0b710cdaab
@ -585,7 +585,7 @@ testQemuGetLatestCaps(void)
|
||||
"s390x",
|
||||
"x86_64",
|
||||
};
|
||||
GHashTable *capslatest = virHashNew(g_free);
|
||||
g_autoptr(GHashTable) capslatest = virHashNew(g_free);
|
||||
size_t i;
|
||||
|
||||
VIR_TEST_VERBOSE("");
|
||||
@ -601,10 +601,9 @@ testQemuGetLatestCaps(void)
|
||||
|
||||
VIR_TEST_VERBOSE("");
|
||||
|
||||
return capslatest;
|
||||
return g_steal_pointer(&capslatest);
|
||||
|
||||
error:
|
||||
virHashFree(capslatest);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user