提交 8927c0ea 编写于 作者: J Ján Tomko 提交者: Martin Kletzander

qemu: fix a crash when save file can't be opened

In qemuDomainSaveMemory, wrapperFd might be NULL and should be checked before
calling virFileWrapperFdCatchError. Same in doCoreDump.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=880919
上级 ebb1ccb5
......@@ -2906,7 +2906,8 @@ qemuDomainSaveMemory(struct qemud_driver *driver,
cleanup:
VIR_FORCE_CLOSE(fd);
virFileWrapperFdCatchError(wrapperFd);
if (wrapperFd)
virFileWrapperFdCatchError(wrapperFd);
virFileWrapperFdFree(wrapperFd);
VIR_FREE(xml);
......@@ -3362,7 +3363,8 @@ doCoreDump(struct qemud_driver *driver,
cleanup:
VIR_FORCE_CLOSE(fd);
if (ret != 0) {
virFileWrapperFdCatchError(wrapperFd);
if (wrapperFd)
virFileWrapperFdCatchError(wrapperFd);
unlink(path);
}
virFileWrapperFdFree(wrapperFd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册