[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/11] block: Don't forget to delete temporary file
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 11/11] block: Don't forget to delete temporary file |
Date: |
Fri, 14 Sep 2012 14:39:12 +0200 |
From: Dunrong Huang <address@hidden>
The caller would not delete temporary file after failed get_tmp_filename().
Signed-off-by: Dunrong Huang <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/block.c b/block.c
index c754353..e78039b 100644
--- a/block.c
+++ b/block.c
@@ -433,7 +433,11 @@ int get_tmp_filename(char *filename, int size)
return -EOVERFLOW;
}
fd = mkstemp(filename);
- if (fd < 0 || close(fd)) {
+ if (fd < 0) {
+ return -errno;
+ }
+ if (close(fd) != 0) {
+ unlink(filename);
return -errno;
}
return 0;
--
1.7.6.5
- [Qemu-devel] [PATCH 04/11] block/curl: Fix wrong free statement, (continued)
- [Qemu-devel] [PATCH 04/11] block/curl: Fix wrong free statement, Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 05/11] vdi: Fix warning from clang, Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 01/11] sheepdog: fix savevm and loadvm, Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 08/11] qapi: Add SnapshotInfo and ImageInfo., Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 02/11] ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0, Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 07/11] ahci: properly reset PxCMD on HBA reset, Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 03/11] ide: Fix error messages from static code analysis (no real error), Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 06/11] block: fix block tray status, Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 10/11] Don't require encryption password for 'qemu-img info' command, Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 09/11] qemu-img: Add json output option to the info command., Kevin Wolf, 2012/09/14
- [Qemu-devel] [PATCH 11/11] block: Don't forget to delete temporary file,
Kevin Wolf <=
- Re: [Qemu-devel] [PULL 00/11] Block patches, Anthony Liguori, 2012/09/17
- Re: [Qemu-devel] [PULL 00/11] Block patches, Michael Tokarev, 2012/09/18