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-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 ED6B31F66E for ; Fri, 14 Aug 2020 16:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728172AbgHNQN3 (ORCPT ); Fri, 14 Aug 2020 12:13:29 -0400 Received: from cloud.peff.net ([104.130.231.41]:59242 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbgHNQN3 (ORCPT ); Fri, 14 Aug 2020 12:13:29 -0400 Received: (qmail 1012 invoked by uid 109); 14 Aug 2020 16:13:29 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 14 Aug 2020 16:13:29 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 26841 invoked by uid 111); 14 Aug 2020 16:13:28 -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; Fri, 14 Aug 2020 12:13:28 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 14 Aug 2020 12:13:28 -0400 From: Jeff King To: git@vger.kernel.org Cc: Eric Sunshine Subject: [PATCH 0/6] more small leak fixes Message-ID: <20200814161328.GA153929@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Based on the discussion over in [1], I wondered how close we were to being able to run some test scripts with a leak-checker like LSan not complaining. The answer is...not close. I picked t5526 more or less at random (it was the first failure when I did a parallel "make test") to see what it would take to get it passing. After much effort...I have t5526.1, the setup test, running clean. :) There were quite a few false positives, but it did actually uncover some legitimate leaks. This series fixes those. I did it independently of the leak-fix in [2], but it would be fine to just lump it all together as one topic. [1] https://lore.kernel.org/git/20200813155426.GA896769@coredump.intra.peff.net/ [2] https://lore.kernel.org/git/20200814111049.GA4101811@coredump.intra.peff.net/ The patches are: [1/6]: submodule--helper: use strbuf_release() to free strbufs [2/6]: checkout: fix leak of non-existent branch names [3/6]: config: fix leaks from git_config_get_string_const() [4/6]: config: drop git_config_get_string_const() [5/6]: config: fix leak in git_config_get_expiry_in_days() [6/6]: submodule--helper: fix leak of core.worktree value Documentation/MyFirstContribution.txt | 4 +-- apply.c | 4 +-- builtin/checkout.c | 4 ++- builtin/fetch.c | 2 +- builtin/submodule--helper.c | 16 +++++------ cache.h | 4 +-- checkout.c | 3 +-- config.c | 39 ++++++++++++++++++++++----- config.h | 12 ++++++--- connect.c | 4 +-- editor.c | 2 +- environment.c | 4 +-- help.c | 2 +- protocol.c | 2 +- submodule.c | 4 +-- t/helper/test-config.c | 2 +- 16 files changed, 69 insertions(+), 39 deletions(-) -Peff