]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/crypto: Fix memory leak in create error path
authorKevin Wolf <kwolf@redhat.com>
Wed, 4 Jul 2018 12:55:06 +0000 (14:55 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 5 Jul 2018 08:29:19 +0000 (10:29 +0200)
Fixes: Coverity CID 1393782
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
block/crypto.c

index 994172a3def1132d62c251f88bcce4235cbc4a3c..146d81c90afcd466aa3c7c1273079b4b275715a5 100644 (file)
@@ -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,