tests: Use g_autoptr(qemuMonitorTest)

Instead of calling qemuMonitorTestFree() explicitly, we can use
g_autoptr() and let it be called automagically.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
This commit is contained in:
Michal Privoznik
2021-11-01 09:51:01 +01:00
parent da71790bbd
commit b118215703
6 changed files with 41 additions and 65 deletions

View File

@@ -72,7 +72,7 @@ testQemuCaps(const void *opaque)
testQemuData *data = (void *) opaque;
g_autofree char *repliesFile = NULL;
g_autofree char *capsFile = NULL;
qemuMonitorTest *mon = NULL;
g_autoptr(qemuMonitorTest) mon = NULL;
g_autoptr(virQEMUCaps) capsActual = NULL;
g_autofree char *binary = NULL;
g_autofree char *actual = NULL;
@@ -132,7 +132,6 @@ testQemuCaps(const void *opaque)
ret = 0;
cleanup:
qemuMonitorTestFree(mon);
return ret;
}