summaryrefslogtreecommitdiff
path: root/src/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/status.c b/src/status.c
index 88dd5e03b..7cd914f21 100644
--- a/src/status.c
+++ b/src/status.c
@@ -43,6 +43,8 @@ static int resolve_head_to_tree(git_tree **tree, git_repository *repo)
if (git_object_lookup(&obj, repo, git_reference_oid(head), GIT_OBJ_ANY) < 0)
goto fail;
+ git_reference_free(head);
+
switch (git_object_type(obj)) {
case GIT_OBJ_TREE:
*tree = (git_tree *)obj;