From patchwork Wed Nov 2 10:40:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9408923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B0B6F60585 for ; Wed, 2 Nov 2016 10:43:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF37E2999D for ; Wed, 2 Nov 2016 10:43:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B257429A76; Wed, 2 Nov 2016 10:43:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BC132999D for ; Wed, 2 Nov 2016 10:43:34 +0000 (UTC) Received: from localhost ([::1]:54030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1t13-0004Zn-Fl for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Nov 2016 06:43:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1t0P-0004Jf-4m for qemu-devel@nongnu.org; Wed, 02 Nov 2016 06:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1t0L-0000RH-8N for qemu-devel@nongnu.org; Wed, 02 Nov 2016 06:42:53 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:35956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1t0L-0000R6-18; Wed, 02 Nov 2016 06:42:49 -0400 Received: by mail-pf0-x241.google.com with SMTP id n85so1444582pfi.3; Wed, 02 Nov 2016 03:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Ykfhobo5uobaMdvdlnC22KxTTONWjXM6ZvChiUv6toM=; b=ZFnIgzOVbDO5BIrYB8ADTlHeRjnvrAQjFZMwSagOnoiAkjbozSKREmzWT36K9AEJmR xWJQzT9n6B8Eyjib0wRu61Ir6Kd3KM9jVLcTwIGghon0p6GoGq/OO0pcXB4AZNzkwT6L T+ejR3VVzIHkdgWHiJ9eYPFW0V++K4aN/PP2FgPPhIH2cff/qJe7r22er0PSfz3dNS5T vb503JwxBqsCPgTh6IcrRblz5VUHsoczkvnqXLVFrc4C9/5tvMyuCfWw+2vi5MAt9sq7 jWiy6ho+LgIjRBOgOu41x3gbQ7C74UTr5JMd0X3PA6w/O0botRCCN8TSgol9eTvp9cvB 7Vsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ykfhobo5uobaMdvdlnC22KxTTONWjXM6ZvChiUv6toM=; b=TYMN6EqUU5I5zDRls9hsxos5SuWPUJEyUx551ofVXXEq3MJwpWbNrIb2nm+N2h8ScS h5FPXdUOYhZb+YBQ/BBbaHlniISPDf4i3SuxXvt78Z3YCQ9puqi4eSs4dhetQXbShnat wqi/CX7rIKLpzQaxa8BgS5VagiWAq3rFYtOLSyxfsPtpiczWcDfpmqfjwNHMdMaYCEHC vX05nook4YP2XkZt4CTcbr73FydYanQez1/WGFuyjvm0jLlsjrxLIp5eeDqGK69/ByW3 qrbfKfvzEgh3RpVvduxuy+op048+l4g1xpAGwGSyJddi95YBh3YnZrAMvTx4JPZI6ak5 TVqg== X-Gm-Message-State: ABUngveJzbWRmlcFskKXqCq9D8/QjbC8HZBHoSxVWtZ/dljRNP+CyFr3Fq988wuALvx7wg== X-Received: by 10.98.92.68 with SMTP id q65mr5627632pfb.53.1478083367872; Wed, 02 Nov 2016 03:42:47 -0700 (PDT) Received: from linux.local ([27.251.197.196]) by smtp.gmail.com with ESMTPSA id a7sm3620114pfl.87.2016.11.02.03.42.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Nov 2016 03:42:47 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Wed, 2 Nov 2016 16:10:03 +0530 Message-Id: <1478083203-9465-1-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH v3] block/nbd: Fix the leaked visitor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com, Ashijeet Acharya , pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch frees the leaked visitor in nbd_refresh_filename() and uses visit_free() to fix it. The leak was introduced by the commit 491d6c7. Signed-off-by: Ashijeet Acharya Reviewed-by: Eric Blake --- Changes in v3: - Modify the Subject line - Free the visitor immediately after visit_complete() --- block/nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nbd.c b/block/nbd.c index 8ef1438..d656eb1 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -534,6 +534,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) ov = qobject_output_visitor_new(&saddr_qdict); visit_type_SocketAddress(ov, NULL, &s->saddr, &error_abort); visit_complete(ov, &saddr_qdict); + visit_free(ov); assert(qobject_type(saddr_qdict) == QTYPE_QDICT); qdict_put_obj(opts, "server", saddr_qdict);