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:
parent
08089edcd2
commit
1afec9138f
|
@ -1131,8 +1131,10 @@ aio_read_f(int argc, char **argv)
|
||||||
case 'P':
|
case 'P':
|
||||||
ctx->Pflag = 1;
|
ctx->Pflag = 1;
|
||||||
ctx->pattern = parse_pattern(optarg);
|
ctx->pattern = parse_pattern(optarg);
|
||||||
if (ctx->pattern < 0)
|
if (ctx->pattern < 0) {
|
||||||
|
free(ctx);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
ctx->qflag = 1;
|
ctx->qflag = 1;
|
||||||
|
|
Loading…
Reference in New Issue