Plug a memleak in builtin-revert
Probably happened when working around git_path's problem with returned buffer being reused. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6e381d3aff
commit
d258b25887
@ -269,7 +269,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
|
|||||||
int i;
|
int i;
|
||||||
char *oneline, *reencoded_message = NULL;
|
char *oneline, *reencoded_message = NULL;
|
||||||
const char *message, *encoding;
|
const char *message, *encoding;
|
||||||
const char *defmsg = xstrdup(git_path("MERGE_MSG"));
|
char *defmsg = xstrdup(git_path("MERGE_MSG"));
|
||||||
|
|
||||||
git_config(git_default_config, NULL);
|
git_config(git_default_config, NULL);
|
||||||
me = action == REVERT ? "revert" : "cherry-pick";
|
me = action == REVERT ? "revert" : "cherry-pick";
|
||||||
@ -426,6 +426,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
|
|||||||
return execv_git_cmd(args);
|
return execv_git_cmd(args);
|
||||||
}
|
}
|
||||||
free(reencoded_message);
|
free(reencoded_message);
|
||||||
|
free(defmsg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user