]> git.proxmox.com Git - libgit2.git/commitdiff
Removing memory leak in mempack's free
authorBryan Woods <woods.bryan@gmail.com>
Fri, 11 Sep 2015 23:35:14 +0000 (16:35 -0700)
committerBryan Woods <woods.bryan@gmail.com>
Fri, 11 Sep 2015 23:35:14 +0000 (16:35 -0700)
It calls git_mempack_reset which reallocates the object array. git_oidmap_free is now called on it explicitly.

src/odb_mempack.c

index 538dfc521e7bd0cb09490b1c870d6dc1190206a5..25f30590c2cb0be9d97d9a6de3d3c565038d8e00 100644 (file)
@@ -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)