diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2011-01-12 19:48:59 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-01-12 19:48:59 +0000 |
commit | 1afec9138f848cfba517bd2d80167b27216b9df9 (patch) | |
tree | 6839b17f33e2085868f18007028b788e474a5a3d /qemu-io.c | |
parent | 08089edcd25b2105a7599309afd0225e839debc6 (diff) | |
download | qemu-1afec9138f848cfba517bd2d80167b27216b9df9.zip qemu-1afec9138f848cfba517bd2d80167b27216b9df9.tar.gz qemu-1afec9138f848cfba517bd2d80167b27216b9df9.tar.bz2 |
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>
Diffstat (limited to 'qemu-io.c')
-rw-r--r-- | qemu-io.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |