diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 09b2791be6..5e2c903f60 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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;