]> xenbits.xensource.com Git - people/andrewcoop/qemu-traditional.git/commitdiff
block-cow: don't close cow_fd twice on error
authorKaifeng Zhu <kaifeng.zhu@citrix.com>
Fri, 7 Mar 2014 15:03:40 +0000 (15:03 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Oct 2015 15:52:06 +0000 (16:52 +0100)
Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
Coverity-ID: 1056200
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
block-cow.c

index 777d8a581706352454b534b3c24973589d931c51..9ad0a32fd88a9e164fad5c23b1ba5b7e9ad1953d 100644 (file)
@@ -224,7 +224,6 @@ static int cow_create(const char *filename, int64_t image_sectors,
 
         fd = open(image_filename, O_RDONLY | O_BINARY);
         if (fd < 0) {
-            close(cow_fd);
             goto mtime_fail;
         }
         if (fstat(fd, &st) != 0) {