From patchwork Tue Mar 18 12:02:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 3853221 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 0DDFC9F334 for ; Wed, 19 Mar 2014 17:43:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AF8720176 for ; Wed, 19 Mar 2014 17:43:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 715BD20131 for ; Wed, 19 Mar 2014 17:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754721AbaCRMFG (ORCPT ); Tue, 18 Mar 2014 08:05:06 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:54557 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754601AbaCRMFE (ORCPT ); Tue, 18 Mar 2014 08:05:04 -0400 X-IronPort-AV: E=Sophos;i="4.97,677,1389715200"; d="scan'208";a="9718674" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 18 Mar 2014 20:01:05 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s2IC4uSR001920 for ; Tue, 18 Mar 2014 20:04:57 +0800 Received: from wangs.fnst.cn.fujitsu.com ([10.167.226.104]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014031820020236-704831 ; Tue, 18 Mar 2014 20:02:02 +0800 From: Wang Shilong To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/6] Btrfs-progs: fsck: fix possible memory leaks in run_next_block() Date: Tue, 18 Mar 2014 20:02:43 +0800 Message-Id: <1395144167-775-2-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1395144167-775-1-git-send-email-wangsl.fnst@cn.fujitsu.com> References: <1395144167-775-1-git-send-email-wangsl.fnst@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/03/18 20:02:02, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/03/18 20:02:03, Serialize complete at 2014/03/18 20:02:03 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=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 We still need free allocated cache memory in case error happens. Signed-off-by: Wang Shilong --- cmds-check.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmds-check.c b/cmds-check.c index c0b7f8c..b3f7e22 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -5909,6 +5909,9 @@ out: free_block_group_tree(&block_group_cache); free_device_extent_tree(&dev_extent_cache); free_extent_cache_tree(&seen); + free_extent_cache_tree(&pending); + free_extent_cache_tree(&reada); + free_extent_cache_tree(&nodes); return ret; }