qemu: Unlink temporary file on failure

Although virFDStreamOpenFile will unlink it once opened, when we hit
error path, we must unlink it by hand.
This commit is contained in:
Michal Privoznik 2011-08-02 17:50:18 +02:00 committed by Eric Blake
parent de5494d8a4
commit d68b97c8a6

View File

@ -2931,7 +2931,10 @@ qemuDomainScreenshot(virDomainPtr dom,
endjob:
VIR_FORCE_CLOSE(tmp_fd);
VIR_FREE(tmp);
if (tmp) {
unlink(tmp);
VIR_FREE(tmp);
}
if (qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL;