Skip to content

Commit 8155961

Browse files
avargitster
authored andcommitted
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. ed378ec (Make ref resolution saner, 2006-09-11) 2. d9e557a (show-branch: store resolved head in heap buffer, 2017-02-14). Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9d01cfe commit 8155961

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/show-branch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,5 +956,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
956956
if (shown_merge_point && --extra < 0)
957957
break;
958958
}
959+
free(head);
959960
return 0;
960961
}

0 commit comments

Comments
 (0)