From: Markus Armbruster Date: Wed, 28 May 2014 09:16:59 +0000 (+0200) Subject: qemu-io: Plug memory leak in open command X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~814^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29f2601aa605f0af0cba8eedcff7812c6c8532e9;p=sdk%2Femulator%2Fqemu.git qemu-io: Plug memory leak in open command Introduced in commit b543c5c. Spotted by Coverity. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- diff --git a/qemu-io.c b/qemu-io.c index ef3fef6..f63e771 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -54,6 +54,7 @@ static int openfile(char *name, int flags, int growable, QDict *opts) if (qemuio_bs) { fprintf(stderr, "file open already, try 'help close'\n"); + QDECREF(opts); return 1; } @@ -175,6 +176,7 @@ static int open_f(BlockDriverState *bs, int argc, char **argv) } else if (optind == argc) { return openfile(NULL, flags, growable, opts); } else { + QDECREF(opts); return qemuio_command_usage(&open_cmd); } }