This reverts
8927c0e qemu: fix a crash when save file can't be opened
and allows virFileWrapperFdCatchError to be called with NULL instead.
cleanup:
VIR_FORCE_CLOSE(fd);
- if (wrapperFd)
- virFileWrapperFdCatchError(wrapperFd);
+ virFileWrapperFdCatchError(wrapperFd);
virFileWrapperFdFree(wrapperFd);
VIR_FREE(xml);
cleanup:
VIR_FORCE_CLOSE(fd);
if (ret != 0) {
- if (wrapperFd)
- virFileWrapperFdCatchError(wrapperFd);
+ virFileWrapperFdCatchError(wrapperFd);
unlink(path);
}
virFileWrapperFdFree(wrapperFd);
void
virFileWrapperFdCatchError(virFileWrapperFdPtr wfd)
{
- if (wfd->err_msg)
+ if (wfd && wfd->err_msg)
VIR_WARN("iohelper reports: %s", wfd->err_msg);
}