Patchwork fix memory leak in aio_write_f

login
register
mail settings
Submitter ajia@redhat.com
Date Sept. 28, 2011, 6:57 a.m.
Message ID <1317193022-13504-1-git-send-email-ajia@redhat.com>
Download mbox | patch
Permalink /patch/116704/
State New
Headers show

Comments

ajia@redhat.com - Sept. 28, 2011, 6:57 a.m.
From: Alex Jia <ajia@redhat.com>

Haven't released memory of 'ctx' before return.

Signed-off-by: Alex Jia <ajia@redhat.com>
---
 qemu-io.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Kevin Wolf - Oct. 17, 2011, 9:57 a.m.
Am 28.09.2011 08:57, schrieb ajia@redhat.com:
> From: Alex Jia <ajia@redhat.com>
> 
> Haven't released memory of 'ctx' before return.
> 
> Signed-off-by: Alex Jia <ajia@redhat.com>

Thanks, applied to the block branch.

Kevin

Patch

diff --git a/qemu-io.c b/qemu-io.c
index e91af37..c45a413 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1248,6 +1248,7 @@  static int aio_write_f(int argc, char **argv)
         case 'P':
             pattern = parse_pattern(optarg);
             if (pattern < 0) {
+                free(ctx);
                 return 0;
             }
             break;