summaryrefslogtreecommitdiff
path: root/src/revparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/revparse.c')
-rw-r--r--src/revparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/revparse.c b/src/revparse.c
index 13778eb11..e03e3338c 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -277,7 +277,7 @@ static int dereference_to_type(git_object **out, git_object *obj, git_otype targ
retcode = GIT_ERROR;
}
}
- if (obj1 != obj) {
+ if (obj1 != obj && obj1 != obj2) {
git_object_free(obj1);
}
obj1 = obj2;