From patchwork Wed Mar 19 06:10:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 3857421 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AC58F9F334 for ; Wed, 19 Mar 2014 18:04:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD60920237 for ; Wed, 19 Mar 2014 18:04:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1404D200E1 for ; Wed, 19 Mar 2014 18:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755730AbaCSGKZ (ORCPT ); Wed, 19 Mar 2014 02:10:25 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:55021 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755680AbaCSGKW convert rfc822-to-8bit (ORCPT ); Wed, 19 Mar 2014 02:10:22 -0400 X-IronPort-AV: E=Sophos;i="4.97,683,1389715200"; d="scan'208";a="28193131" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 19 Mar 2014 14:07:38 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s2J69wtD013048 for ; Wed, 19 Mar 2014 14:09:58 +0800 Received: from G08CNEXMBPEKD02.g08.fujitsu.local ([10.167.33.84]) by G08CNEXCHPEKD01.g08.fujitsu.local ([10.167.33.80]) with mapi id 14.03.0146.002; Wed, 19 Mar 2014 14:10:10 +0800 From: "quwenruo@cn.fujitsu.com" To: "linux-btrfs@vger.kernel.org" Subject: [PATCH 1/3] btrfs-progs: Fix memleak in get_raid56_used() Thread-Topic: [PATCH 1/3] btrfs-progs: Fix memleak in get_raid56_used() Thread-Index: AQHPQzne5szHf2GsTk2T0HoTuFqr0A== Date: Wed, 19 Mar 2014 06:10:02 +0000 Message-ID: <1395209466-17042-1-git-send-email-quwenruo@cn.fujitsu.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.167.226.24] MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Fix memleak in get_raid56_used(). Signed-off-by: Qu Wenruo --- cmds-fi-disk_usage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-fi-disk_usage.c b/cmds-fi-disk_usage.c index a3b06be..2bd591d 100644 --- a/cmds-fi-disk_usage.c +++ b/cmds-fi-disk_usage.c @@ -352,6 +352,7 @@ static int get_raid56_used(int fd, u64 *raid5_used, u64 *raid6_used) if (p->type & BTRFS_BLOCK_GROUP_RAID6) (*raid6_used) += p->size / (p->num_stripes -2); } + free(info_ptr); return 0;