From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id DDC3A1F8C6 for ; Tue, 31 Aug 2021 19:38:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240938AbhHaTjO (ORCPT ); Tue, 31 Aug 2021 15:39:14 -0400 Received: from cloud.peff.net ([104.130.231.41]:35482 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbhHaTjN (ORCPT ); Tue, 31 Aug 2021 15:39:13 -0400 Received: (qmail 13266 invoked by uid 109); 31 Aug 2021 19:38:17 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 31 Aug 2021 19:38:17 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 29370 invoked by uid 111); 31 Aug 2021 19:38:18 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 31 Aug 2021 15:38:18 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 31 Aug 2021 15:38:16 -0400 From: Jeff King To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Junio C Hamano , Marius Storm-Olsen Subject: Re: [PATCH] mailmap.c: fix a memory leak in free_mailap_{info,entry}() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Aug 31, 2021 at 03:42:52PM +0200, Ævar Arnfjörð Bjarmason wrote: > In the free_mailmap_entry() code added in 0925ce4d49 (Add map_user() > and clear_mailmap() to mailmap, 2009-02-08) the intent was clearly to > clear the "me" structure, but while we freed parts of the > mailmap_entry structure, we didn't free the structure itself. The same > goes for the "mailmap_info" structure. > > This brings us from 50 failures when running t4203-mailmap.sh to > 49. Not really progress as far as the number of failures is concerned, > but as far as I can tell this fixes all leaks in mailmap.c > itself. There's still users of it such as builtin/log.c that call > read_mailmap() without a clear_mailmap(), but that's on them. > > Signed-off-by: Ævar Arnfjörð Bjarmason > --- Thanks, the patch looks good to me. I agree with Eric that mentioning "leak failures" in the second paragraph would make it less confusing. :) -Peff