From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Taylor Blau" <me@ttaylorr.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 0/6] leaks: miscellaneous small leak fixes
Date: Fri, 22 Oct 2021 10:55:38 +0200 [thread overview]
Message-ID: <cover-v2-0.6-00000000000-20211022T085306Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.6-00000000000-20211021T155529Z-avarab@gmail.com>
A re-roll of these miscellaneous small leak fixes to a address
comments on v1. I ejected the patch that conflicted with Taylor's
version (sorry, didn't notice it), and fixed an additional leak in
grep.c pointed out by Junio. Doing that allowed us to mark a test as
passing under SANITIZE=leak, with only the minor change of replacing a
"git checkout" with "git reset --hard" (as "checkout" happens to leak
currently, but I've also got a pending patch for that).
Ævar Arnfjörð Bjarmason (6):
grep: prefer "struct grep_opt" over its "void *" equivalent
grep: use object_array_clear() in cmd_grep()
grep: fix a "path_list" memory leak
clone: fix a memory leak of the "git_dir" variable
submodule--helper: fix small memory leaks
reflog: free() ref given to us by dwim_log()
builtin/clone.c | 4 +++-
builtin/grep.c | 14 ++++++++------
builtin/reflog.c | 1 +
builtin/submodule--helper.c | 2 ++
t/t7811-grep-open.sh | 3 ++-
5 files changed, 16 insertions(+), 8 deletions(-)
Range-diff against v1:
1: 2bdd21e4e59 ! 1: 66c838fd800 grep: prefer "struct grep_opt" over its "void *"
@@ Metadata
Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
## Commit message ##
- grep: prefer "struct grep_opt" over its "void *"
+ grep: prefer "struct grep_opt" over its "void *" equivalent
Stylistically fix up code added in bfac23d9534 (grep: Fix two memory
leaks, 2010-01-30). We usually don't use the "arg" at all once we've
- unpacked it into the struct we want, let's not do that here when we're
+ casted it to the struct we want, let's not do that here when we're
freeing it. Perhaps it was thought that a cast to "void *" would
otherwise be needed?
2: 727fdb27a2a = 2: 033ca3f7b4f grep: use object_array_clear() in cmd_grep()
-: ----------- > 3: 8e941e40711 grep: fix a "path_list" memory leak
3: 86d928ae2f9 = 4: 0d0e6359cf4 clone: fix a memory leak of the "git_dir" variable
4: 9c3c0529ad0 = 5: a529c04a29a submodule--helper: fix small memory leaks
5: 85b7b7aef37 = 6: 6ea5e611ae0 reflog: free() ref given to us by dwim_log()
6: 526d5649156 < -: ----------- repack: stop leaking a "struct child_process"
--
2.33.1.1494.g88b39a443e1
next prev parent reply other threads:[~2021-10-22 8:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 15:57 [PATCH 0/6] leaks: miscellaneous small leak fixes Ævar Arnfjörð Bjarmason
2021-10-21 15:57 ` [PATCH 1/6] grep: prefer "struct grep_opt" over its "void *" Ævar Arnfjörð Bjarmason
2021-10-21 23:52 ` Junio C Hamano
2021-10-21 15:57 ` [PATCH 2/6] grep: use object_array_clear() in cmd_grep() Ævar Arnfjörð Bjarmason
2021-10-21 23:56 ` Junio C Hamano
2021-10-21 23:58 ` Junio C Hamano
2021-10-21 15:57 ` [PATCH 3/6] clone: fix a memory leak of the "git_dir" variable Ævar Arnfjörð Bjarmason
2021-10-22 0:07 ` Junio C Hamano
2021-10-21 15:57 ` [PATCH 4/6] submodule--helper: fix small memory leaks Ævar Arnfjörð Bjarmason
2021-10-21 15:57 ` [PATCH 5/6] reflog: free() ref given to us by dwim_log() Ævar Arnfjörð Bjarmason
2021-10-22 0:16 ` Junio C Hamano
2021-10-21 15:57 ` [PATCH 6/6] repack: stop leaking a "struct child_process" Ævar Arnfjörð Bjarmason
2021-10-22 0:22 ` Junio C Hamano
2021-10-22 8:55 ` Ævar Arnfjörð Bjarmason [this message]
2021-10-22 8:55 ` [PATCH v2 1/6] grep: prefer "struct grep_opt" over its "void *" equivalent Ævar Arnfjörð Bjarmason
2021-10-22 8:55 ` [PATCH v2 2/6] grep: use object_array_clear() in cmd_grep() Ævar Arnfjörð Bjarmason
2021-10-22 8:55 ` [PATCH v2 3/6] grep: fix a "path_list" memory leak Ævar Arnfjörð Bjarmason
2021-10-22 8:55 ` [PATCH v2 4/6] clone: fix a memory leak of the "git_dir" variable Ævar Arnfjörð Bjarmason
2021-10-22 8:55 ` [PATCH v2 5/6] submodule--helper: fix small memory leaks Ævar Arnfjörð Bjarmason
2021-10-22 8:55 ` [PATCH v2 6/6] reflog: free() ref given to us by dwim_log() Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover-v2-0.6-00000000000-20211022T085306Z-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).