filterstr = virLogGetFilters();
if (!filterstr) {
virReportOOMError();
- goto cleanup;
+ goto error;
}
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_FILTERS", filterstr);
outputstr = virLogGetOutputs();
if (!outputstr) {
virReportOOMError();
- goto cleanup;
+ goto error;
}
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_OUTPUTS", outputstr);
char *tmp = NULL;
if (virAsprintf(&tmp, "--share-%s",
nsInfoLocal[i]) < 0)
- goto cleanup;
+ goto error;
virCommandAddArg(cmd, tmp);
virCommandAddArgFormat(cmd, "%d", nsInheritFDs[i]);
virCommandPassFD(cmd, nsInheritFDs[i], 0);
* write the live domain status XML with the PID */
virCommandRequireHandshake(cmd);
- return cmd;
cleanup:
- virCommandFree(cmd);
virObjectUnref(cfg);
- return NULL;
+ return cmd;
+ error:
+ virCommandFree(cmd);
+ cmd = NULL;
+ goto cleanup;
}