On Fri, Oct 07, 2016 at 11:21:23PM +0200, Christian Hesse wrote: > "Jason A. Donenfeld" <[email protected]> on Fri, 2016/10/07 21:43: > > Does this ever get freed, though? > > I ran cgit in valgrind with this patch applied. No changes in what is lost - > so looks like this is freed later on.
It isn't lost because there's a global reference to it via the commit cache, but valgrind's "still reachable" statistic definitely grows as a result of this patch. I don't think this is the cause of the underlying problem Sylvain reported. That's more likely to be the use of get_cached_commit_buffer() in cgit_parse_commit(). Shouldn't that be get_commit_buffer(), which uses the cached buffer if it's available? Otherwise we must call libgit's parse_commit() before calling cgit_parse_commit(), which all seems a bit fragile. _______________________________________________ CGit mailing list [email protected] http://lists.zx2c4.com/mailman/listinfo/cgit
