提交 1afec913 编写于 作者: B Blue Swirl

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: NBlue Swirl <blauwirbel@gmail.com>
上级 08089edc
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册