Plug a memleak in builtin-revert
PATCH 1/1 Plug a memleak in builtin-revert
Probably happened when working around git_path's problem with returned buffer being reused.
--- builtin-revert.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
builtin-revert.c +2 -1
@@ -251,7 +251,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)int i, index_fd, clean;char *oneline, *reencoded_message =NULL ;const char *message, *encoding; -const char *defmsg =xstrdup (git_path ("MERGE_MSG" )); +char *defmsg =xstrdup (git_path ("MERGE_MSG" ));struct merge_options o;struct tree *result, *next_tree, *base_tree, *head_tree;static struct lock_file index_lock;
@@ -432,6 +432,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)return execv_git_cmd (args); }free (reencoded_message); +free (defmsg);return 0 ; }
Signature · 1 line
1.6.0.3.549.gb475d