Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Plug a memleak in builtin-revert
author
Alex Riesen
<raa.lkml@gmail.com>
Tue, 28 Oct 2008 17:27:33 +0000
(18:27 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 30 Oct 2008 21:01:00 +0000
(14:01 -0700)
Probably happened when working around git_path's problem with returned
buffer being reused.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-revert.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
6e381d3
)
diff --git
a/builtin-revert.c
b/builtin-revert.c
index 27881e94937dd79b9a0524eb2d9770427ec4f4fb..c41788685bf0b5bea3a3ae26615795e07a995793 100644
(file)
--- a/
builtin-revert.c
+++ b/
builtin-revert.c
@@
-269,7
+269,7
@@
static int revert_or_cherry_pick(int argc, const char **argv)
int i;
char *oneline, *reencoded_message = NULL;
const char *message, *encoding;
- c
onst c
har *defmsg = xstrdup(git_path("MERGE_MSG"));
+ char *defmsg = xstrdup(git_path("MERGE_MSG"));
git_config(git_default_config, NULL);
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);
}
free(reencoded_message);
+ free(defmsg);
return 0;
}