diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-07-07 14:12:56 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-07 14:12:57 -0700 |
| commit | d4a59c5a29c3b7145c2835e2cde007d96d550e0a (patch) | |
| tree | 48d4a51873609b9c11fb9c00cb4e46f7f347b1c8 /builtin/send-pack.c | |
| parent | Merge branch 'cb/daemon-fd-check-fix' (diff) | |
| parent | send-pack: clean-up even when taking an early exit (diff) | |
| download | git-d4a59c5a29c3b7145c2835e2cde007d96d550e0a.tar.gz git-d4a59c5a29c3b7145c2835e2cde007d96d550e0a.zip | |
Merge branch 'jk/fix-leak-send-pack'
Leakfix.
* jk/fix-leak-send-pack:
send-pack: clean-up even when taking an early exit
send-pack: clean up extra_have oid array
Diffstat (limited to 'builtin/send-pack.c')
| -rw-r--r-- | builtin/send-pack.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/send-pack.c b/builtin/send-pack.c index c6e0e9d051..28b69d26b4 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -304,9 +304,10 @@ int cmd_send_pack(int argc, flags |= MATCH_REFS_MIRROR; /* match them up */ - if (match_push_refs(local_refs, &remote_refs, &rs, flags)) - return -1; - + if (match_push_refs(local_refs, &remote_refs, &rs, flags)) { + ret = -1; + goto cleanup; + } if (!is_empty_cas(&cas)) apply_push_cas(&cas, remote, remote_refs); @@ -339,10 +340,12 @@ int cmd_send_pack(int argc, /* stable plumbing output; do not modify or localize */ fprintf(stderr, "Everything up-to-date\n"); +cleanup: string_list_clear(&push_options, 0); free_refs(remote_refs); free_refs(local_refs); refspec_clear(&rs); + oid_array_clear(&extra_have); oid_array_clear(&shallow); clear_cas_option(&cas); return ret; |
