From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrSjX-00027J-QQ for qemu-devel@nongnu.org; Mon, 02 Jun 2014 09:57:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrSjR-0003Pe-Ml for qemu-devel@nongnu.org; Mon, 02 Jun 2014 09:57:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrSjR-0003PK-EZ for qemu-devel@nongnu.org; Mon, 02 Jun 2014 09:56:57 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s52DuuaW022474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 2 Jun 2014 09:56:56 -0400 From: Kevin Wolf Date: Mon, 2 Jun 2014 15:56:37 +0200 Message-Id: <1401717408-4607-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1401717408-4607-1-git-send-email-kwolf@redhat.com> References: <1401717408-4607-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 06/17] 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: kwolf@redhat.com From: Markus Armbruster Introduced in commit b543c5c. Spotted by Coverity. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- qemu-io.c | 2 ++ 1 file changed, 2 insertions(+) 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); } } -- 1.8.3.1