summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Wolf2018-07-04 14:55:06 +0200
committerKevin Wolf2018-07-05 10:29:19 +0200
commit0b68589d17ef2ea78b3cf016525db13cee1d99e7 (patch)
treed53f4084d612d104e40d466fa323deb7759a151a
parentblock: Don't silently truncate node names (diff)
downloadqemu-0b68589d17ef2ea78b3cf016525db13cee1d99e7.tar.gz
qemu-0b68589d17ef2ea78b3cf016525db13cee1d99e7.tar.xz
qemu-0b68589d17ef2ea78b3cf016525db13cee1d99e7.zip
block/crypto: Fix memory leak in create error path
Fixes: Coverity CID 1393782 Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
-rw-r--r--block/crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/crypto.c b/block/crypto.c
index 994172a3de..146d81c90a 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -551,7 +551,7 @@ static int coroutine_fn block_crypto_co_create_opts_luks(const char *filename,
/* Create protocol layer */
ret = bdrv_create_file(filename, opts, errp);
if (ret < 0) {
- return ret;
+ goto fail;
}
bs = bdrv_open(filename, NULL, NULL,