From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNgzt-0005Gd-4T for qemu-devel@nongnu.org; Wed, 12 Mar 2014 07:06:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNgzo-00083D-1A for qemu-devel@nongnu.org; Wed, 12 Mar 2014 07:06:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNgzn-00082y-QW for qemu-devel@nongnu.org; Wed, 12 Mar 2014 07:06:47 -0400 From: Stefan Hajnoczi Date: Wed, 12 Mar 2014 11:29:26 +0100 Message-Id: <1394620172-25071-19-git-send-email-stefanha@redhat.com> In-Reply-To: <1394620172-25071-1-git-send-email-stefanha@redhat.com> References: <1394620172-25071-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 18/24] block: Unlink temporary file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori From: Max Reitz If the image file cannot be opened and was created as a temporary file, it should be deleted; thus, in this case, we should jump to the "unlink_and_fail" label and not just to "fail". Reported-by: Beno=C3=AEt Canet Signed-off-by: Max Reitz Acked-by: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index cf5645a..fae50c9 100644 --- a/block.c +++ b/block.c @@ -1321,7 +1321,7 @@ int bdrv_open(BlockDriverState **pbs, const char *f= ilename, bdrv_open_flags(bs, flags | BDRV_O_UNMAP) | BDRV_O_PROTOCOL, true, &local_err); if (ret < 0) { - goto fail; + goto unlink_and_fail; } =20 /* Find the right image format driver */ --=20 1.8.5.3