git/builtin
Patrick Steinhardt f87c55c264 object-name: free leaking object contexts
While it is documented in `struct object_context::path` that this
variable needs to be released by the caller, this fact is rather easy to
miss given that we do not ever provide a function to release the object
context. And of course, while some callers dutifully release the path,
many others don't.

Introduce a new `object_context_release()` function that releases the
path. Convert callsites that used to free the path to use that new
function and add missing calls to callsites that were leaking memory.
Refactor those callsites as required to have a single return path, only.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-06-11 13:15:05 -07:00
..
add.c Merge branch 'ps/the-index-is-no-more' 2024-05-08 10:18:44 -07:00
am.c Merge branch 'ps/refs-without-the-repository' 2024-05-16 10:10:14 -07:00
annotate.c
apply.c apply: fix uninitialized hash function 2024-05-21 09:07:48 -07:00
archive.c parse-options: fix leaks for users of OPT_FILENAME 2024-06-11 13:15:04 -07:00
bisect.c cocci: apply rules to rewrite callers of "refs" interfaces 2024-05-07 10:06:59 -07:00
blame.c Merge branch 'ps/leakfixes' into ps/leakfixes-more 2024-06-03 13:08:33 -07:00
branch.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
bugreport.c
bundle.c builtin/bundle: abort "verify" early when there is no repository 2024-05-06 22:50:49 -07:00
cat-file.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c
checkout.c checkout: clarify memory ownership in unique_tracking_name() 2024-05-27 11:19:58 -07:00
clean.c
clone.c Merge branch 'jc/fix-2.45.1-and-friends-for-maint' 2024-05-30 14:15:17 -07:00
column.c
commit-graph.c
commit-tree.c
commit.c parse-options: fix leaks for users of OPT_FILENAME 2024-06-11 13:15:04 -07:00
config.c Merge branch 'ps/leakfixes' into ps/leakfixes-more 2024-06-03 13:08:33 -07:00
count-objects.c
credential-cache--daemon.c Merge branch 'bc/credential-scheme-enhancement' 2024-05-08 10:18:44 -07:00
credential-cache.c Merge branch 'bc/credential-scheme-enhancement' 2024-05-08 10:18:44 -07:00
credential-store.c
credential.c builtin/credential: clear credential before exit 2024-05-27 11:20:01 -07:00
describe.c refs: pass repo when peeling objects 2024-05-17 10:33:39 -07:00
diagnose.c
diff-files.c
diff-index.c
diff-tree.c
diff.c builtin/diff: explicitly set hash algo when there is no repo 2024-05-06 22:50:49 -07:00
difftool.c
fast-export.c
fast-import.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
fetch-pack.c
fetch.c Merge branch 'ps/refs-without-the-repository-updates' 2024-05-30 14:15:13 -07:00
fmt-merge-msg.c parse-options: fix leaks for users of OPT_FILENAME 2024-06-11 13:15:04 -07:00
for-each-ref.c ref-filter: properly distinuish pseudo and root refs 2024-05-15 07:30:52 -07:00
for-each-repo.c for-each-repo: optionally keep going on an error 2024-04-24 10:46:03 -07:00
fsck.c cocci: apply rules to rewrite callers of "refs" interfaces 2024-05-07 10:06:59 -07:00
fsmonitor--daemon.c
gc.c refs: pass repo when peeling objects 2024-05-17 10:33:39 -07:00
get-tar-commit-id.c
grep.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
hash-object.c builtin/hash-object: fix uninitialized hash function 2024-05-21 09:05:13 -07:00
help.c
hook.c
index-pack.c
init-db.c
interpret-trailers.c Merge branch 'la/hide-trailer-info' 2024-05-23 11:04:27 -07:00
log.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
ls-files.c
ls-remote.c
ls-tree.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c config: clarify memory ownership in git_config_string() 2024-05-27 11:20:00 -07:00
mktag.c
mktree.c
multi-pack-index.c parse-options: fix leaks for users of OPT_FILENAME 2024-06-11 13:15:04 -07:00
mv.c builtin/mv: fix leaks for submodule gitfile paths 2024-05-27 11:20:03 -07:00
name-rev.c cocci: apply rules to rewrite callers of "refs" interfaces 2024-05-07 10:06:59 -07:00
notes.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
pack-objects.c Merge branch 'ps/refs-without-the-repository-updates' 2024-05-30 14:15:13 -07:00
pack-redundant.c
pack-refs.c
patch-id.c builtin/patch-id: fix uninitialized hash function 2024-05-21 09:05:13 -07:00
prune-packed.c
prune.c
pull.c Merge branch 'ps/refs-without-the-repository' 2024-05-16 10:10:14 -07:00
push.c
range-diff.c
read-tree.c
rebase.c config: clarify memory ownership in git_config_string() 2024-05-27 11:20:00 -07:00
receive-pack.c config: clarify memory ownership in git_config_string() 2024-05-27 11:20:00 -07:00
reflog.c refs: remove dwim_log() 2024-05-17 10:33:39 -07:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'ps/refs-without-the-repository-updates' 2024-05-30 14:15:13 -07:00
repack.c Merge branch 'ps/leakfixes' into ps/leakfixes-more 2024-06-03 13:08:33 -07:00
replace.c Merge branch 'ps/refs-without-the-repository-updates' 2024-05-30 14:15:13 -07:00
replay.c
rerere.c
reset.c Merge branch 'ps/refs-without-the-repository' 2024-05-16 10:10:14 -07:00
rev-list.c builtin/rev-list: fix leaking bitmap index when calculating disk usage 2024-06-11 13:15:05 -07:00
rev-parse.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
revert.c
rm.c
send-pack.c
shortlog.c builtin/shortlog: don't set up revisions without repo 2024-05-06 22:50:50 -07:00
show-branch.c cocci: apply rules to rewrite callers of "refs" interfaces 2024-05-07 10:06:59 -07:00
show-index.c
show-ref.c refs: pass repo when peeling objects 2024-05-17 10:33:39 -07:00
sparse-checkout.c parse-options: fix leaks for users of OPT_FILENAME 2024-06-11 13:15:04 -07:00
stash.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
stripspace.c
submodule--helper.c refs: refactor resolve_gitlink_ref() to accept a repository 2024-05-17 10:33:38 -07:00
symbolic-ref.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
tag.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
unpack-file.c
unpack-objects.c
update-index.c refs: refactor resolve_gitlink_ref() to accept a repository 2024-05-17 10:33:38 -07:00
update-ref.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
update-server-info.c
upload-archive.c
upload-pack.c Sync with 2.44.1 2024-04-29 20:42:30 +02:00
var.c refs: drop git_default_branch_name() 2024-05-17 10:33:39 -07:00
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c Merge branch 'ps/leakfixes' into ps/leakfixes-more 2024-06-03 13:08:33 -07:00
write-tree.c