Jonathan Nieder [off-list ref] writes:
This buffer is freed by the C runtime when commit-tree exits moments
later, but freeing it explicitly should hopefully make this code
easier to reuse (in addition to making valgrind quieter).
I'd agree this is a change in a good direction because it will reduce
false positives from valgrind. I do not believe it would make it any
easier to reuse, though. Read what the code does (e.g. calling
git-config, showing usage or dying on sick arguments, etc.). So I have to
say that the proposed commit log message advertises a benefit that it does
not bring.
By the way, is there an easy and concise way to tell valgrind to
(1) treat allocations made in main() that are not freed as non-issues;
and
(2) treat functions whose name begin with cmd_ as if they are all their
own main(), and apply the above special casing to them?