Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
odb: mempack: fix leaking objects when freeing mempacks
When a ODB mempack gets free'd, we take no measures at all to free its
contents, most notably the objects added to the database, resulting in a
memory leak. Call `git_mempack_reset` previous to freeing the ODB
structures themselves, which takes care of releasing all associated
data structures.
  • Loading branch information
pks-t committed Mar 29, 2018
commit b6276ae0915522b6add6ac2da9900a617515f0eb
1 change: 1 addition & 0 deletions src/odb_mempack.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static void impl__free(git_odb_backend *_backend)
{
struct memory_packer_db *db = (struct memory_packer_db *)_backend;

git_mempack_reset(_backend);
git_oidmap_free(db->objects);
git__free(db);
}
Expand Down