From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (szxga03-in.huawei.com [45.249.212.189]) by sourceware.org (Postfix) with ESMTPS id B1129384B104 for ; Mon, 20 Apr 2020 13:49:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B1129384B104 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=chenzefeng2@huawei.com Received: from DGGEMM406-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id F1EBCF9AE7A29BF07A01 for ; Mon, 20 Apr 2020 21:49:18 +0800 (CST) Received: from dggeme758-chm.china.huawei.com (10.3.19.104) by DGGEMM406-HUB.china.huawei.com (10.3.20.214) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 20 Apr 2020 21:49:18 +0800 Received: from dggeme756-chm.china.huawei.com (10.3.19.102) by dggeme758-chm.china.huawei.com (10.3.19.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1913.5; Mon, 20 Apr 2020 21:49:18 +0800 Received: from dggeme756-chm.china.huawei.com ([10.6.80.68]) by dggeme756-chm.china.huawei.com ([10.6.80.68]) with mapi id 15.01.1913.007; Mon, 20 Apr 2020 21:49:18 +0800 From: "chenzefeng (A)" To: Florian Weimer CC: "libc-alpha@sourceware.org" , "liucheng (G)" , Zengweilin Subject: RE: [PATCH] malloc: fix memleak in function muntrace Thread-Topic: [PATCH] malloc: fix memleak in function muntrace Thread-Index: AQHWFh107hMOZZNg9EaFmBECW7m8FKiAUkQOgAG0FrA= Date: Mon, 20 Apr 2020 13:49:18 +0000 Message-ID: References: <20200419073754.72967-1-chenzefeng2@huawei.com> <87wo6b1z7l.fsf@mid.deneb.enyo.de> In-Reply-To: <87wo6b1z7l.fsf@mid.deneb.enyo.de> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.101.243] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Spam-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 13:49:23 -0000 * Florian Weimer: >* chenzefeng: >> diff --git a/malloc/mtrace.c b/malloc/mtrace.c index=20 >> 7e7719df97..0b92106e6e 100644 >> --- a/malloc/mtrace.c >> +++ b/malloc/mtrace.c >> @@ -365,4 +365,6 @@ muntrace (void) >> =20 >> fprintf (f, "=3D End\n"); >> fclose (f); >> + if (mtb !=3D NULL) >> + free (mtb); >> } >I don't think this will build. The global variable is called malloc_trace= _buffer. I am sorry, I had not got the correctly patch from local file. I commit it = again, thanks for you review.