[PATCH 3/3] ui-stats.c: set parent pointer to NULL after freeing it

John Keeping john at keeping.me.uk
Sun Jul 27 12:56:20 CEST 2014


We do this everywhere else, so we should be doing it here as well.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 ui-stats.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui-stats.c b/ui-stats.c
index 6f13c32..a264f6a 100644
--- a/ui-stats.c
+++ b/ui-stats.c
@@ -246,6 +246,7 @@ static struct string_list collect_stats(struct cgit_period *period)
 		add_commit(&authors, commit, period);
 		free_commit_buffer(commit);
 		free_commit_list(commit->parents);
+		commit->parents = NULL;
 	}
 	return authors;
 }
-- 
2.0.1.472.g6f92e5f.dirty



More information about the CGit mailing list