mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue