summaryrefslogtreecommitdiff
path: root/builtin/ls-remote.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-04-07 16:54:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-04-07 16:54:08 -0700
commit642a40019c99a42f5f4ed4f3e52b9ab92cd75fe7 (patch)
tree03da4a9395b7d4eda1517fb783e246cfeb80c965 /builtin/ls-remote.c
parentThe sixth batch (diff)
parenttransport: also free remote_refs in transport_disconnect() (diff)
downloadtgif-642a40019c99a42f5f4ed4f3e52b9ab92cd75fe7.tar.xz
Merge branch 'ah/plugleaks'
Plug or annotate remaining leaks that trigger while running the very basic set of tests. * ah/plugleaks: transport: also free remote_refs in transport_disconnect() parse-options: don't leak alias help messages parse-options: convert bitfield values to use binary shift init-db: silence template_dir leak when converting to absolute path init: remove git_init_db_config() while fixing leaks worktree: fix leak in dwim_branch() clone: free or UNLEAK further pointers when finished reset: free instead of leaking unneeded ref symbolic-ref: don't leak shortened refname in check_symref()
Diffstat (limited to 'builtin/ls-remote.c')
-rw-r--r--builtin/ls-remote.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index abfa984737..1794548c71 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -124,8 +124,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
int hash_algo = hash_algo_by_ptr(transport_get_hash_algo(transport));
repo_set_hash_algo(the_repository, hash_algo);
}
- if (transport_disconnect(transport))
- return 1;
if (!dest && !quiet)
fprintf(stderr, "From %s\n", *remote->url);
@@ -151,5 +149,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
}
ref_array_clear(&ref_array);
+ if (transport_disconnect(transport))
+ return 1;
return status;
}