Commit bae780e0843b4ccae3367cd247e8ea6cd0674482

Ben Straub 2012-05-04T10:31:57

Rev-parse: fixing double-freeing. Thanks, Visual Studio!

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/revparse.c b/src/revparse.c
index 13778eb..e03e333 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;