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 <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2011-01-12 19:48:59 +00:00
parent 08089edcd2
commit 1afec9138f
1 changed files with 3 additions and 1 deletions

View File

@ -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;