diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-06-23 21:21:17 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-23 21:21:17 +0300 |
commit | 4e4fc50cf733bb0071e43ea128b13439b93975d2 (patch) | |
tree | a9b89a59e36a3a0687ec1d3eb21a30cc909070c9 /builtin | |
parent | 1d15be363ccf0ff4337886568087d0467c93c9a9 (diff) | |
parent | 80d32e84b5ffc0f678fef2560ef386b1ef98b964 (diff) |
Merge branch 'rj/leakfixes'
Leakfixes
* rj/leakfixes:
tests: mark as passing with SANITIZE=leak
config: fix a leak in git_config_copy_or_rename_section_in_file
branch: fix a leak in cmd_branch
branch: fix a leak in setup_tracking
rev-parse: fix a leak with --abbrev-ref
branch: fix a leak in setup_tracking
branch: fix a leak in check_tracking_branch
branch: fix a leak in inherit_tracking
branch: fix a leak in dwim_and_setup_tracking
remote: fix a leak in query_matches_negative_refspec
config: fix a leak in git_config_copy_or_rename_section_in_file
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/branch.c | 2 | ||||
-rw-r--r-- | builtin/rev-parse.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index e6c2655af6..075e580d22 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -832,6 +832,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix) if (list) setup_auto_pager("branch", 1); + UNLEAK(sorting_options); + if (delete) { if (!argc) die(_("branch name required")); diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 852e49e340..d2eb239a08 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -156,9 +156,12 @@ static void show_rev(int type, const struct object_id *oid, const char *name) */ break; case 1: /* happy */ - if (abbrev_ref) + if (abbrev_ref) { + char *old = full; full = shorten_unambiguous_ref(full, abbrev_ref_strict); + free(old); + } show_with_type(type, full); break; default: /* ambiguous */ |