Skip to content

Commit fd2014d

Browse files
stefanbellergitster
authored andcommitted
builtin/help.c: fix memory leak
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c8a571d commit fd2014d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/help.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static void list_common_guides_help(void)
456456
int cmd_help(int argc, const char **argv, const char *prefix)
457457
{
458458
int nongit;
459-
const char *alias;
459+
char *alias;
460460
enum help_format parsed_help_format;
461461

462462
argc = parse_options(argc, argv, prefix, builtin_help_options,
@@ -499,6 +499,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)
499499
alias = alias_lookup(argv[0]);
500500
if (alias && !is_git_command(argv[0])) {
501501
printf_ln(_("`git %s' is aliased to `%s'"), argv[0], alias);
502+
free(alias);
502503
return 0;
503504
}
504505

0 commit comments

Comments
 (0)