libgit2/libgit2 — pull request #2510 by csware (2014-08-09 12:58:10+00:00)
Title: Check NULL before calling free

In TortoiseGit we're experiencing a significant number of crashes with free in errors.c, however, we don't know where exactly (the crashreports we have point to https://github.com/libgit2/libgit2/blob/master/src/errors.c#L74, but there is no `free` - but in set_error there is a `free`).

So: Might it be possible that error->message is uninitialized or error->message is NULL (the crashreports do not include any variable assignments)?

This PR assumes that it is NULL and tries to fix that.