diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-10-02 07:46:25 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-10-02 07:46:26 -0700 |
| commit | 365529e1ea19b44a7a253b780f3ae3a1cb2f081f (patch) | |
| tree | 5a34837f74d165858246b1dd9706b926d7a998e5 /revision.c | |
| parent | Merge branch 'ds/sparse-checkout-expansion-advice' (diff) | |
| parent | diffcore-break: fix leaking filespecs when merging broken pairs (diff) | |
| download | git-365529e1ea19b44a7a253b780f3ae3a1cb2f081f.tar.gz git-365529e1ea19b44a7a253b780f3ae3a1cb2f081f.zip | |
Merge branch 'ps/leakfixes-part-7'
More leak-fixes.
* ps/leakfixes-part-7: (23 commits)
diffcore-break: fix leaking filespecs when merging broken pairs
revision: fix leaking parents when simplifying commits
builtin/maintenance: fix leak in `get_schedule_cmd()`
builtin/maintenance: fix leaking config string
promisor-remote: fix leaking partial clone filter
grep: fix leaking grep pattern
submodule: fix leaking submodule ODB paths
trace2: destroy context stored in thread-local storage
builtin/difftool: plug several trivial memory leaks
builtin/repack: fix leaking configuration
diffcore-order: fix leaking buffer when parsing orderfiles
parse-options: free previous value of `OPTION_FILENAME`
diff: fix leaking orderfile option
builtin/pull: fix leaking "ff" option
dir: fix off by one errors for ignored and untracked entries
builtin/submodule--helper: fix leaking remote ref on errors
t/helper: fix leaking subrepo in nested submodule config helper
builtin/submodule--helper: fix leaking error buffer
builtin/submodule--helper: clear child process when not running it
submodule: fix leaking update strategy
...
Diffstat (limited to 'revision.c')
| -rw-r--r-- | revision.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 2d7ad2bddf..e79f39e555 100644 --- a/revision.c +++ b/revision.c @@ -1071,7 +1071,11 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit) ts->treesame[nth_parent] = 1; continue; } + + free_commit_list(parent->next); parent->next = NULL; + while (commit->parents != parent) + pop_commit(&commit->parents); commit->parents = parent; /* @@ -1103,6 +1107,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit) die("cannot simplify commit %s (invalid %s)", oid_to_hex(&commit->object.oid), oid_to_hex(&p->object.oid)); + free_commit_list(p->parents); p->parents = NULL; } /* fallthrough */ |
