From e206946da781cfc9de145f3364d3c42f82188a80 Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Thu, 31 Mar 2011 11:28:21 +0800 Subject: [PATCH] free tmp after unlinking it We create a temporary file to save memory, and we will remove it after reading memory to buffer. But we free the variable that contains the temporary filename before we remove it. So we should free tmp after unlinking it. --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dd12dc8550..5aa715e1b2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5065,9 +5065,9 @@ endjob: vm = NULL; cleanup: - VIR_FREE(tmp); VIR_FORCE_CLOSE(fd); unlink (tmp); + VIR_FREE(tmp); if (vm) virDomainObjUnlock(vm); return ret; -- 2.39.5