From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF83M-0000S4-AX for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:43:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF830-0005MX-6A for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:43:20 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:45178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF830-0005MD-0F for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:42:58 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Aug 2014 16:42:57 -0400 From: Michael Roth Date: Wed, 6 Aug 2014 15:39:11 -0500 Message-Id: <1407357598-21541-62-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 061/108] qemu-io: Plug memory leak in open command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Markus Armbruster Introduced in commit b543c5c. Spotted by Coverity. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf (cherry picked from commit 29f2601aa605f0af0cba8eedcff7812c6c8532e9) Signed-off-by: Michael Roth --- qemu-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu-io.c b/qemu-io.c index 5d7b53f..bc1277d 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; } @@ -171,6 +172,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); } } -- 1.9.1