qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/blkdebug: fix memory leak
@ 2020-10-09 19:09 Elena Afanasova
  2020-10-09 19:56 ` Eric Blake
  2020-10-12 14:38 ` Laurent Vivier
  0 siblings, 2 replies; 3+ messages in thread
From: Elena Afanasova @ 2020-10-09 19:09 UTC (permalink / raw)
  To: kwolf, mreitz, qemu-block, qemu-devel; +Cc: qemu-trivial

Spotted by PVS-Studio

Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
---
 block/blkdebug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/blkdebug.c b/block/blkdebug.c
index eecbf3e5c4..54da719dd1 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -215,6 +215,7 @@ static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
                                  BLKDEBUG_IO_TYPE__MAX, &local_error);
         if (local_error) {
             error_propagate(errp, local_error);
+            g_free(rule);
             return -1;
         }
         if (iotype != BLKDEBUG_IO_TYPE__MAX) {
-- 
2.25.1




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

* Re: [PATCH] block/blkdebug: fix memory leak
  2020-10-09 19:09 [PATCH] block/blkdebug: fix memory leak Elena Afanasova
@ 2020-10-09 19:56 ` Eric Blake
  2020-10-12 14:38 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2020-10-09 19:56 UTC (permalink / raw)
  To: Elena Afanasova, kwolf, mreitz, qemu-block, qemu-devel; +Cc: qemu-trivial


[-- Attachment #1.1: Type: text/plain, Size: 898 bytes --]

On 10/9/20 2:09 PM, Elena Afanasova wrote:
> Spotted by PVS-Studio
> 
> Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
> ---
>  block/blkdebug.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/block/blkdebug.c b/block/blkdebug.c
> index eecbf3e5c4..54da719dd1 100644
> --- a/block/blkdebug.c
> +++ b/block/blkdebug.c
> @@ -215,6 +215,7 @@ static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
>                                   BLKDEBUG_IO_TYPE__MAX, &local_error);
>          if (local_error) {
>              error_propagate(errp, local_error);
> +            g_free(rule);
>              return -1;
>          }
>          if (iotype != BLKDEBUG_IO_TYPE__MAX) {
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] block/blkdebug: fix memory leak
  2020-10-09 19:09 [PATCH] block/blkdebug: fix memory leak Elena Afanasova
  2020-10-09 19:56 ` Eric Blake
@ 2020-10-12 14:38 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2020-10-12 14:38 UTC (permalink / raw)
  To: Elena Afanasova, kwolf, mreitz, qemu-block, qemu-devel; +Cc: qemu-trivial

Le 09/10/2020 à 21:09, Elena Afanasova a écrit :
> Spotted by PVS-Studio
> 
> Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
> ---
>  block/blkdebug.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/block/blkdebug.c b/block/blkdebug.c
> index eecbf3e5c4..54da719dd1 100644
> --- a/block/blkdebug.c
> +++ b/block/blkdebug.c
> @@ -215,6 +215,7 @@ static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
>                                   BLKDEBUG_IO_TYPE__MAX, &local_error);
>          if (local_error) {
>              error_propagate(errp, local_error);
> +            g_free(rule);
>              return -1;
>          }
>          if (iotype != BLKDEBUG_IO_TYPE__MAX) {
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



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

end of thread, other threads:[~2020-10-12 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-09 19:09 [PATCH] block/blkdebug: fix memory leak Elena Afanasova
2020-10-09 19:56 ` Eric Blake
2020-10-12 14:38 ` Laurent Vivier

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).