From patchwork Sun Aug 16 06:59:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11715975 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3593C722 for ; Sun, 16 Aug 2020 06:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16C072065C for ; Sun, 16 Aug 2020 06:59:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qR0exCh3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729319AbgHPG7P (ORCPT ); Sun, 16 Aug 2020 02:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728364AbgHPG7O (ORCPT ); Sun, 16 Aug 2020 02:59:14 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79722C061786 for ; Sat, 15 Aug 2020 23:59:14 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id 9so10709251wmj.5 for ; Sat, 15 Aug 2020 23:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:date:subject:fcc:content-transfer-encoding :mime-version:to:cc; bh=o+NT3mjfl1uyPOqkU4gZpZjyOt0Hbnii4eBQDAp66Tk=; b=qR0exCh3azVw6DEqdy2ma0Qy40ikKE3hSW+XyLCkJQby64htDyfGGpP/uPd1HEfxH/ +zKnutj81NLovxIFZjqmye/uZQbN0a9I5YN3KGUpfO72JonetxQ3y4CTirWGDmg06eeN nblqoY4bGxWwzFj63dSyAt8RBiyRjiaNNXE3ewuBE7q96klQ61r04a0P2Tqe2KAJseyu GwxD/kJK9pqfHzBqJejvX2vcy2s7j7GLd0iAEwTs+ORZpdEAepGZOmZfflN6PAHxCXO8 b+tfuT4GQbkPP6jSvCCl35fZgvbyyKf8jlXbCReyfVh81ukQfd4B7OiWrEkfZKfELaE6 /0Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=o+NT3mjfl1uyPOqkU4gZpZjyOt0Hbnii4eBQDAp66Tk=; b=OqLAp/H6fhD3OhxB/LuimDrSVNKGjnqHaADBAiokICVP6WnM0HAYqiVYm+lOSFP2BC Kd0pKP9G5//+vepdlk8H9OpfCq4gXdKQfHRdYkJU3/2AMMIFNNmNPp2zS0k+DMePxcJ+ nNeCmx3OS+dcrE464/RbniahgY7vMSzooAcskz6Avb8s3n963sNSTk8sq3OFBvuXNRI7 LIwIdNNOks+MtWXp2dPt7r17dPgZhEewlYfGD1Gi+vkMcBrWwbTvJiHM0EYKxLTZZ6mb Rp2kVv5Pbw/nk1j4jAxPcewe9PgSczRWcHOTnlCAcbCLGmYwOAj0DS8Q0qRaQe04bBtH tgpA== X-Gm-Message-State: AOAM531UMcXetQmw67EkM6GadQdxpMNBnfmEI0zPfvrViApud0BgjQB/ g4uZ7GvpmphmQeyWRFvbDrmHPtE7o5o= X-Google-Smtp-Source: ABdhPJwxqibzPtxcH3cYp6hgZSQRSCeBy2CD9/7BypFHe4xUT5uGzhn6k7Q9QO+pVh7YoHMgtieqTA== X-Received: by 2002:a1c:e919:: with SMTP id q25mr9319907wmc.123.1597561153066; Sat, 15 Aug 2020 23:59:13 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id d23sm25224497wmd.27.2020.08.15.23.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2020 23:59:12 -0700 (PDT) Message-Id: From: "Elijah Newren via GitGitGadget" Date: Sun, 16 Aug 2020 06:59:08 +0000 Subject: [PATCH 0/3] Clean up some memory leaks in and around dir.c Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Some memory leaks in dir.c were making it hard for me to find my own leaks in merge-ort. I followed a few threads and tried to both clean up the leaks and make the API less prone to incorrect use. Elijah Newren (3): dir: fix leak of parent_hashmap and recursive_hashmap dir: make clear_directory() free all relevant memory dir: fix problematic API to avoid memory leaks builtin/add.c | 4 ++-- builtin/check-ignore.c | 4 ++-- builtin/clean.c | 12 ++++-------- builtin/grep.c | 3 ++- builtin/ls-files.c | 4 ++-- builtin/stash.c | 7 ++----- dir.c | 23 ++++++++++++++++++----- dir.h | 21 +++++++++++---------- merge.c | 3 ++- wt-status.c | 8 ++------ 10 files changed, 47 insertions(+), 42 deletions(-) base-commit: 878e727637ec5815ccb3301eb994a54df95b21b8 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-831%2Fnewren%2Fdir_memory_cleanup-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-831/newren/dir_memory_cleanup-v1 Pull-Request: https://github.com/git/git/pull/831