From patchwork Tue Jan 14 11:17:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 3485281 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0F94DC02DC for ; Tue, 14 Jan 2014 11:08:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C2A2201F9 for ; Tue, 14 Jan 2014 11:08:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1EB99201E9 for ; Tue, 14 Jan 2014 11:08:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbaANLH7 (ORCPT ); Tue, 14 Jan 2014 06:07:59 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:36833 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbaANLH4 (ORCPT ); Tue, 14 Jan 2014 06:07:56 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0EB7tF4021084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Jan 2014 11:07:56 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0EB7sXX020696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 14 Jan 2014 11:07:55 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0EB7sre022378 for ; Tue, 14 Jan 2014 11:07:54 GMT Received: from wish.sg.oracle.com (/10.186.101.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 14 Jan 2014 03:07:54 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/2] btrfs-progs: mid flight return leaks memory during filesystem show mnt Date: Tue, 14 Jan 2014 19:17:08 +0800 Message-Id: <1389698228-9580-2-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1389698228-9580-1-git-send-email-anand.jain@oracle.com> References: <1389698228-9580-1-git-send-email-anand.jain@oracle.com> X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP since now handle_print()->print_one_fs() calls add_seen_fsid() the thread has to go through free_seen_fsid() Signed-off-by: Anand Jain --- cmds-filesystem.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index ee6cc84..d38fae6 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -681,10 +681,11 @@ static int cmd_show(int argc, char **argv) } } else if (type == BTRFS_ARG_MNTPOINT) { char label[BTRFS_LABEL_SIZE]; - if (get_label_mounted(search, label)) + ret = get_label_mounted(search, label); + if (ret) return 1; handle_print(search, label); - return 0; + goto out; } }