summaryrefslogtreecommitdiff
path: root/src/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tree.c b/src/tree.c
index b609eea33..31a581cdb 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);
}
@@ -727,7 +730,7 @@ int git_tree_entry_bypath(
if (!git_tree_entry__is_tree(entry)) {
giterr_set(GITERR_TREE,
"The path '%s' does not exist in the given tree", path);
- return -1;
+ return GIT_ENOTFOUND;
}
/* If there's only a slash left in the path, we