From 1afec9138f848cfba517bd2d80167b27216b9df9 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Wed, 12 Jan 2011 19:48:59 +0000 Subject: qemu-io: fix a memory leak Fix a memory leak, reported by cppcheck: [/src/qemu/qemu-io.c:1135]: (error) Memory leak: ctx Signed-off-by: Blue Swirl --- qemu-io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qemu-io.c') diff --git a/qemu-io.c b/qemu-io.c index 65dee13..5b24c5e 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1131,8 +1131,10 @@ aio_read_f(int argc, char **argv) case 'P': ctx->Pflag = 1; ctx->pattern = parse_pattern(optarg); - if (ctx->pattern < 0) + if (ctx->pattern < 0) { + free(ctx); return 0; + } break; case 'q': ctx->qflag = 1; -- cgit v1.1