summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d596118)
raw | patch | inline | side by side (parent: d596118)
author | Ramkumar Ramachandra <artagnon@gmail.com> | |
Wed, 14 Dec 2011 16:54:28 +0000 (22:24 +0530) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 15 Dec 2011 21:00:22 +0000 (13:00 -0800) |
Memory allocated to the fields of msg by get_message() isn't freed.
This is potentially a big leak, because fresh memory is allocated to
store the commit message for each commit. Fix this using
free_message().
Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This is potentially a big leak, because fresh memory is allocated to
store the commit message for each commit. Fix this using
free_message().
Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/revert.c | patch | blob | history |
diff --git a/builtin/revert.c b/builtin/revert.c
index 028bcbcd75d21ada2bc0406ff74e3073014bb41f..76a1633b9bdc42393c9b8e3c6a4641c42a6ee950 100644 (file)
--- a/builtin/revert.c
+++ b/builtin/revert.c
if (get_message(cur->item, &msg))
return error(_("Cannot get commit message for %s"), sha1_abbrev);
strbuf_addf(buf, "%s %s %s\n", action_str, sha1_abbrev, msg.subject);
+ free_message(&msg);
}
return 0;
}