diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-09-30 11:22:21 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-30 11:22:21 -0700 |
| commit | a5031223cda0f37f70b901f7a2b7cd78e0627d82 (patch) | |
| tree | 766afb63402fbd7cfeb371e4e8f36ed3f3d171cb /http-fetch.c | |
| parent | Merge branch 'ps/leakfixes-part-7' into ps/leakfixes-part-8 (diff) | |
| parent | http-push: clean up local_refs at exit (diff) | |
| download | git-a5031223cda0f37f70b901f7a2b7cd78e0627d82.tar.gz git-a5031223cda0f37f70b901f7a2b7cd78e0627d82.zip | |
Merge branch 'jk/http-leakfixes' into ps/leakfixes-part-8
* jk/http-leakfixes: (28 commits)
http-push: clean up local_refs at exit
http-push: clean up loose request when falling back to packed
http-push: clean up objects list
http-push: free xml_ctx.cdata after use
http-push: free remote_ls_ctx.dentry_name
http-push: free transfer_request strbuf
http-push: free transfer_request dest field
http-push: free curl header lists
http-push: free repo->url string
http-push: clear refspecs before exiting
http-walker: free fake packed_git list
remote-curl: free HEAD ref with free_one_ref()
http: stop leaking buffer in http_get_info_packs()
http: call git_inflate_end() when releasing http_object_request
http: fix leak of http_object_request struct
http: fix leak when redacting cookies from curl trace
transport-helper: fix leak of dummy refs_list
fetch-pack: clear pack lockfiles list
fetch: free "raw" string when shrinking refspec
transport-helper: fix strbuf leak in push_refs_with_push()
...
Diffstat (limited to 'http-fetch.c')
| -rw-r--r-- | http-fetch.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/http-fetch.c b/http-fetch.c index d460bb1837..02ab80533f 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -106,6 +106,7 @@ int cmd_main(int argc, const char **argv) int nongit; struct object_id packfile_hash; struct strvec index_pack_args = STRVEC_INIT; + int ret; setup_git_directory_gently(&nongit); @@ -157,8 +158,8 @@ int cmd_main(int argc, const char **argv) fetch_single_packfile(&packfile_hash, argv[arg], index_pack_args.v); - - return 0; + ret = 0; + goto out; } if (index_pack_args.nr) @@ -170,7 +171,12 @@ int cmd_main(int argc, const char **argv) commit_id = (char **) &argv[arg++]; commits = 1; } - return fetch_using_walker(argv[arg], get_verbosely, get_recover, - commits, commit_id, write_ref, - commits_on_stdin); + + ret = fetch_using_walker(argv[arg], get_verbosely, get_recover, + commits, commit_id, write_ref, + commits_on_stdin); + +out: + strvec_clear(&index_pack_args); + return ret; } |
