summaryrefslogtreecommitdiff
path: root/tests/odb
diff options
context:
space:
mode:
authorArthur Schreiber <schreiber.arthur@googlemail.com>2015-10-01 00:50:37 +0200
committerArthur Schreiber <schreiber.arthur@googlemail.com>2015-10-01 00:50:37 +0200
commitd3b29fb94bf1c1d0caec39b4a2c3d2061c63efec (patch)
tree2b8c5a5972d066c3c059d58b72e35ffa25511b1f /tests/odb
parentba1a5553e43c7d5853dda21b1fce2a32e0ce4fd2 (diff)
downloadlibgit2-d3b29fb94bf1c1d0caec39b4a2c3d2061c63efec.tar.gz
refdb and odb backends must provide `free` function
As refdb and odb backends can be allocated by client code, libgit2 can’t know whether an alternative memory allocator was used, and thus should not try to call `git__free` on those objects. Instead, odb and refdb backend implementations must always provide their own `free` functions to ensure memory gets freed correctly.
Diffstat (limited to 'tests/odb')
-rw-r--r--tests/odb/sorting.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/odb/sorting.c b/tests/odb/sorting.c
index 147a160c8..d24c49c69 100644
--- a/tests/odb/sorting.c
+++ b/tests/odb/sorting.c
@@ -14,6 +14,7 @@ static git_odb_backend *new_backend(size_t position)
if (b == NULL)
return NULL;
+ b->base.free = (void (*)(git_odb_backend *)) git__free;
b->base.version = GIT_ODB_BACKEND_VERSION;
b->position = position;
return (git_odb_backend *)b;