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
This commit is contained in:
Junio C Hamano
2023-06-23 11:21:17 -07:00
16 changed files with 29 additions and 7 deletions

View File

@@ -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"));

View File

@@ -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 */