提交 7794e02c 编写于 作者: J Ján Tomko 提交者: Osier Yang

util: check for NULL parameter in virFileWrapperFdCatchError

This reverts 8927c0ea qemu: fix a crash when save file can't be opened
and allows virFileWrapperFdCatchError to be called with NULL instead.
上级 03619176
......@@ -2908,8 +2908,7 @@ qemuDomainSaveMemory(struct qemud_driver *driver,
cleanup:
VIR_FORCE_CLOSE(fd);
if (wrapperFd)
virFileWrapperFdCatchError(wrapperFd);
virFileWrapperFdCatchError(wrapperFd);
virFileWrapperFdFree(wrapperFd);
VIR_FREE(xml);
......@@ -3365,8 +3364,7 @@ doCoreDump(struct qemud_driver *driver,
cleanup:
VIR_FORCE_CLOSE(fd);
if (ret != 0) {
if (wrapperFd)
virFileWrapperFdCatchError(wrapperFd);
virFileWrapperFdCatchError(wrapperFd);
unlink(path);
}
virFileWrapperFdFree(wrapperFd);
......
......@@ -369,7 +369,7 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd)
void
virFileWrapperFdCatchError(virFileWrapperFdPtr wfd)
{
if (wfd->err_msg)
if (wfd && wfd->err_msg)
VIR_WARN("iohelper reports: %s", wfd->err_msg);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册