From: list at eworm.de (Christian Hesse)
Subject: [PATCH 1/1] ui-log: fix data corruption
Date: Fri, 7 Oct 2016 15:35:26 +0200 [thread overview]
Message-ID: <20161007133526.2931-1-list@eworm.de> (raw)
From: Christian Hesse <mail at eworm.de>
This data is allocated in a bigger context. So we should not free it
here to prevent data corruption.
Signed-off-by: Christian Hesse <mail at eworm.de>
---
ui-log.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/ui-log.c b/ui-log.c
index a31ff7c..cba91af 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -484,9 +484,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; /* nop */) {
if (show_commit(commit, &rev))
i++;
- free_commit_buffer(commit);
- free_commit_list(commit->parents);
- commit->parents = NULL;
}
for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; /* nop */) {
@@ -506,9 +503,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
i++;
print_commit(commit, &rev);
}
- free_commit_buffer(commit);
- free_commit_list(commit->parents);
- commit->parents = NULL;
}
if (pager) {
html("</table><ul class='pager'>");
--
2.10.0
next reply other threads:[~2016-10-07 13:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 13:35 list [this message]
2016-10-07 19:43 ` Jason
2016-10-07 21:21 ` list
2016-10-07 21:25 ` list
2016-10-09 11:26 ` john
2016-10-10 14:00 ` list
2016-10-12 11:23 ` Jason
2016-10-16 11:54 ` john
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161007133526.2931-1-list@eworm.de \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).