diff options
author | Bryan Woods <woods.bryan@gmail.com> | 2015-09-11 16:35:14 -0700 |
---|---|---|
committer | Bryan Woods <woods.bryan@gmail.com> | 2015-09-11 16:35:14 -0700 |
commit | 707f65372b4091ada386f2a04a05e94899e32bfc (patch) | |
tree | f331399b94e6d1db9294a0b10499692bbdcca2fa | |
parent | 8e177b2bb8cacc3ca9e1edd301a8aa1132f300af (diff) | |
download | libgit2-707f65372b4091ada386f2a04a05e94899e32bfc.tar.gz |
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.
-rw-r--r-- | src/odb_mempack.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/odb_mempack.c b/src/odb_mempack.c index 538dfc521..25f30590c 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) |