From patchwork Tue Apr 23 21:04:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10913747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B99A61390 for ; Tue, 23 Apr 2019 21:04:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A749B287EF for ; Tue, 23 Apr 2019 21:04:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AD7828952; Tue, 23 Apr 2019 21:04:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5314C287EF for ; Tue, 23 Apr 2019 21:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbfDWVEP (ORCPT ); Tue, 23 Apr 2019 17:04:15 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:39424 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfDWVEO (ORCPT ); Tue, 23 Apr 2019 17:04:14 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3NKxn4O076980; Tue, 23 Apr 2019 21:04:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=a07jLjaTGmTRqt2C/xEW7rf6OXxjHGJjM6mX3xMfhRA=; b=M6ol/RhJBnYgUi3fLYJlvh/CPZS7rp/kMnRv5niu8jlxPOF80YpG580vugMSAAo79dYo rzQDGLn4C1X9/sJEtFkhAp1rFXnbjBawzLeW+YyWfDq80awF45WzZ1sHjWq5fXC8lD65 IytDL6rys/rLsYet2+iSd0Hict1hl+TyRJPlZodot04DFvZgNV0ptca5YLEZXdI/6ApP aHhGVkhmramSYeqTkJRFEgw4eZk5IVVNDxGrelMpOuS/mYCevP1+AnrcU3UfrsVIvPgM aD1e31Km6lrVAxiBxGgLoTqwVCsEM0l/qUJs1P+mk4omc/IsdJlcd29A8uFrRBFVH47n 2g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2ryv2q6mwp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Apr 2019 21:04:12 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3NL2t1a001308; Tue, 23 Apr 2019 21:04:11 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2s0fv3754f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Apr 2019 21:04:11 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x3NL4Ari014455; Tue, 23 Apr 2019 21:04:10 GMT Received: from localhost (/10.145.179.89) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 23 Apr 2019 14:04:10 -0700 Date: Tue, 23 Apr 2019 14:04:09 -0700 From: "Darrick J. Wong" To: sandeen@sandeen.net Cc: linux-xfs@vger.kernel.org Subject: [PATCH 11/10] libfrog: fix memory leak in bitmap_free Message-ID: <20190423210409.GC178290@magnolia> References: <155594788997.115924.16224143537288136652.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <155594788997.115924.16224143537288136652.stgit@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9236 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=838 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904230149 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9236 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=879 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904230149 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Free the bitmap struct before we null out the caller's pointer. Signed-off-by: Darrick J. Wong Reviewed-by: Bill O'Donnell --- libfrog/bitmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libfrog/bitmap.c b/libfrog/bitmap.c index aecdba0d..450ebe0a 100644 --- a/libfrog/bitmap.c +++ b/libfrog/bitmap.c @@ -104,6 +104,7 @@ bitmap_free( free(ext); } free(bmap->bt_tree); + free(bmap); *bmapp = NULL; }