OSDN Git Service

fix memory leak in aio_write_f
authorAlex Jia <ajia@redhat.com>
Wed, 28 Sep 2011 06:57:01 +0000 (14:57 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 21 Oct 2011 15:34:12 +0000 (17:34 +0200)
Haven't released memory of 'ctx' before return.

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-io.c

index e91af37..c45a413 100644 (file)
--- 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;