show-branch: free() allocated "head" before return
Stop leaking the "head" variable, which we've been leaking since it was originally added in [1], and in its current form since [2] 1.ed378ec7e8
(Make ref resolution saner, 2006-09-11) 2.d9e557a320
(show-branch: store resolved head in heap buffer, 2017-02-14). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9d01cfed69
commit
81559612a9
@ -956,5 +956,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||
if (shown_merge_point && --extra < 0)
|
||||
break;
|
||||
}
|
||||
free(head);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user