goto cleanup;
}
- qemuDomainObjEnterMonitor(vm);
+ qemuDomainObjEnterMonitorWithDriver(driver, vm);
qemuDomainObjPrivatePtr priv = vm->privateData;
ret = qemuMonitorGetPtyPaths(priv->mon, paths);
- qemuDomainObjExitMonitor(vm);
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
VIR_DEBUG("qemuMonitorGetPtyPaths returned %i", ret);
if (ret == 0) {
/* Path is everything after needle to the end of the line */
*eol = '\0';
- char *path = needle + strlen(NEEDLE);
+ char *path = strdup(needle + strlen(NEEDLE));
+ if (path == NULL) {
+ virReportOOMError(NULL);
+ goto cleanup;
+ }
- virHashAddEntry(paths, id, strdup(path));
+ if (virHashAddEntry(paths, id, path) < 0) {
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
+ _("failed to save chardev path '%s'"),
+ path);
+ VIR_FREE(path);
+ goto cleanup;
+ }
#undef NEEDLE
next: