gid_t runGid,
bool forceTCG)
{
- qemuProcessQMPPtr ret = NULL;
- qemuProcessQMPPtr proc = NULL;
+ g_autoptr(qemuProcessQMP) proc = NULL;
const char *threadSuffix;
g_autofree char *threadName = NULL;
binary, libDir, runUid, runGid, forceTCG);
if (VIR_ALLOC(proc) < 0)
- goto cleanup;
+ return NULL;
proc->binary = g_strdup(binary);
proc->libDir = g_strdup(libDir);
threadName = g_strdup_printf("qmp-%s", threadSuffix);
if (!(proc->eventThread = virEventThreadNew(threadName)))
- goto cleanup;
-
- ret = g_steal_pointer(&proc);
+ return NULL;
- cleanup:
- qemuProcessQMPFree(proc);
- return ret;
+ return g_steal_pointer(&proc);
}