List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/1] ui-log: fix data corruption
@ 2016-10-07 13:35 list
  2016-10-07 19:43 ` Jason
  0 siblings, 1 reply; 8+ messages in thread
From: list @ 2016-10-07 13:35 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-16 11:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 13:35 [PATCH 1/1] ui-log: fix data corruption list
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

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).