From bae780e0843b4ccae3367cd247e8ea6cd0674482 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Fri, 4 May 2012 10:31:57 -0700 Subject: [PATCH] Rev-parse: fixing double-freeing. Thanks, Visual Studio! --- src/revparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;