diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-10-10 14:22:27 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-10-10 14:22:29 -0700 |
| commit | 31bc4454de66c22bc8570fd3af52a99843ac69b0 (patch) | |
| tree | 605cb77cc73bdece2a856d2a34286aa4f2bb780c /remote.c | |
| parent | d29d644d18737c7fbc2651ddbda64a3b552d9acb (diff) | |
| parent | 66893a14d0c0d3850227def321312a7290317610 (diff) | |
| download | git-31bc4454de66c22bc8570fd3af52a99843ac69b0.tar.xz | |
Merge branch 'ps/leakfixes-part-8'
More leakfixes.
* ps/leakfixes-part-8: (23 commits)
builtin/send-pack: fix leaking list of push options
remote: fix leaking push reports
t/helper: fix leaks in proc-receive helper
pack-write: fix return parameter of `write_rev_file_order()`
revision: fix leaking saved parents
revision: fix memory leaks when rewriting parents
midx-write: fix leaking buffer
pack-bitmap-write: fix leaking OID array
pseudo-merge: fix leaking strmap keys
pseudo-merge: fix various memory leaks
line-log: fix several memory leaks
diff: improve lifecycle management of diff queues
builtin/revert: fix leaking `gpg_sign` and `strategy` config
t/helper: fix leaking repository in partial-clone helper
builtin/clone: fix leaking repo state when cloning with bundle URIs
builtin/pack-redundant: fix various memory leaks
builtin/stash: fix leaking `pathspec_from_file`
submodule: fix leaking submodule entry list
wt-status: fix leaking buffer with sparse directories
shell: fix leaking strings
...
Diffstat (limited to 'remote.c')
| -rw-r--r-- | remote.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -868,6 +868,20 @@ struct strvec *push_url_of_remote(struct remote *remote) return remote->pushurl.nr ? &remote->pushurl : &remote->url; } +void ref_push_report_free(struct ref_push_report *report) +{ + while (report) { + struct ref_push_report *next = report->next; + + free(report->ref_name); + free(report->old_oid); + free(report->new_oid); + free(report); + + report = next; + } +} + static int match_name_with_pattern(const char *key, const char *name, const char *value, char **result) { @@ -1122,6 +1136,7 @@ void free_one_ref(struct ref *ref) if (!ref) return; free_one_ref(ref->peer_ref); + ref_push_report_free(ref->report); free(ref->remote_status); free(ref->tracking_ref); free(ref->symref); |
