qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block/crypto: Fix memory leak in create error path
@ 2018-07-04 12:58 Kevin Wolf
  2018-07-04 13:11 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2018-07-04 12:58 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, mreitz, qemu-devel

Fixes: Coverity CID 1393782
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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,
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] block/crypto: Fix memory leak in create error path
  2018-07-04 12:58 [Qemu-devel] [PATCH] block/crypto: Fix memory leak in create error path Kevin Wolf
@ 2018-07-04 13:11 ` Daniel P. Berrangé
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2018-07-04 13:11 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, qemu-devel, mreitz

On Wed, Jul 04, 2018 at 02:58:02PM +0200, Kevin Wolf wrote:
> Fixes: Coverity CID 1393782
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/crypto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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,

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-04 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-04 12:58 [Qemu-devel] [PATCH] block/crypto: Fix memory leak in create error path Kevin Wolf
2018-07-04 13:11 ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).