Yes, stupid of me.  I would have sworn, I did think about freeing it and I saw similar code which did not free it, so I copied that pattern.  But I cannot find that example code anymore, so it is probably a figment of my imagination.  
Anyway, git_buf_free is added. in a newer commit.