Fix memory leaks and warnings in github_commits.c