Commit f95121cb4f9da6c5b06c9d0b31c2c9a969c1c09d

Michael Schubert 2012-06-20T18:07:27

object: add missing git_odb_object_free

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/object.c b/src/object.c
index d3673ed..14d64be 100644
--- a/src/object.c
+++ b/src/object.c
@@ -156,8 +156,10 @@ int git_object_lookup_prefix(
 
 	type = odb_obj->raw.type;
 
-	if (create_object(&object, type) < 0)
+	if (create_object(&object, type) < 0) {
+		git_odb_object_free(odb_obj);
 		return -1;
+	}
 
 	/* Initialize parent object */
 	git_oid_cpy(&object->cached.oid, &odb_obj->cached.oid);