A `git_buf` is guaranteed to be NUL-terminated, so there's no need to check for the size. Furthermore, the buf is being freed right before being used. That `C.git_buf_free` should be a defer.