Commit d1a7d0e12a078b4f04b0106ab9be59eded8d0c52

Bryan Woods 2015-09-11T16:35:14

Removing memory leak in mempack's free It calls git_mempack_reset which reallocates the object array. git_oidmap_free is now called on it explicitly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/odb_mempack.c b/src/odb_mempack.c
index 538dfc5..25f3059 100644
--- a/src/odb_mempack.c
+++ b/src/odb_mempack.c
@@ -161,8 +161,12 @@ void git_mempack_reset(git_odb_backend *_backend)
 
 static void impl__free(git_odb_backend *_backend)
 {
-	git_mempack_reset(_backend);
-	git__free(_backend);
+	struct memory_packer_db *db = (struct memory_packer_db *)_backend;
+
+	git_mempack_reset(db);
+	git_oidmap_free(db->objects);
+
+	git__free(db);
 }
 
 int git_mempack_new(git_odb_backend **out)