mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-15 09:05:16 +00:00
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
This commit is contained in:
parent
ebb1ccb517
commit
8927c0eab6
@ -2906,6 +2906,7 @@ qemuDomainSaveMemory(struct qemud_driver *driver,
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
|
if (wrapperFd)
|
||||||
virFileWrapperFdCatchError(wrapperFd);
|
virFileWrapperFdCatchError(wrapperFd);
|
||||||
virFileWrapperFdFree(wrapperFd);
|
virFileWrapperFdFree(wrapperFd);
|
||||||
VIR_FREE(xml);
|
VIR_FREE(xml);
|
||||||
@ -3362,6 +3363,7 @@ doCoreDump(struct qemud_driver *driver,
|
|||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
if (wrapperFd)
|
||||||
virFileWrapperFdCatchError(wrapperFd);
|
virFileWrapperFdCatchError(wrapperFd);
|
||||||
unlink(path);
|
unlink(path);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user