tree: prevent git_tree_entry_free() from segfaulting when being passed a NULL tree_entry
diff --git a/src/tree.c b/src/tree.c
index b609eea..4d22f2f 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -140,6 +140,9 @@ static int tree_key_search(git_vector *entries, const char *filename, size_t fil
void git_tree_entry_free(git_tree_entry *entry)
{
+ if (entry == NULL)
+ return;
+
git__free(entry);
}