diff options
| author | Arthur Schreiber <schreiber.arthur@googlemail.com> | 2015-10-01 00:50:37 +0200 |
|---|---|---|
| committer | Arthur Schreiber <schreiber.arthur@googlemail.com> | 2015-10-01 00:50:37 +0200 |
| commit | d3b29fb94bf1c1d0caec39b4a2c3d2061c63efec (patch) | |
| tree | 2b8c5a5972d066c3c059d58b72e35ffa25511b1f /tests/odb | |
| parent | ba1a5553e43c7d5853dda21b1fce2a32e0ce4fd2 (diff) | |
| download | libgit2-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.c | 1 |
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; |
