pack: packfile_free -> git_packfile_free and use it in the indexers It turns out the indexers have been ignoring the pack's free function and leaking data. Plug that.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/src/indexer.c b/src/indexer.c
index 599228f..70b2ce0 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -747,7 +747,7 @@ void git_indexer_stream_free(git_indexer_stream *idx)
git_vector_foreach(&idx->deltas, i, delta)
git__free(delta);
git_vector_free(&idx->deltas);
- git__free(idx->pack);
+ git_packfile_free(idx->pack);
git__free(idx);
}
@@ -1059,7 +1059,7 @@ void git_indexer_free(git_indexer *idx)
git_vector_foreach(&idx->pack->cache, i, pe)
git__free(pe);
git_vector_free(&idx->pack->cache);
- git__free(idx->pack);
+ git_packfile_free(idx->pack);
git__free(idx);
}
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 9d0c4c0..9779ecd 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -538,7 +538,7 @@ static void pack_backend__free(git_odb_backend *_backend)
for (i = 0; i < backend->packs.length; ++i) {
struct git_pack_file *p = git_vector_get(&backend->packs, i);
- packfile_free(p);
+ git_packfile_free(p);
}
git_vector_free(&backend->packs);
diff --git a/src/pack.c b/src/pack.c
index cc9d079..6084508 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -794,7 +794,7 @@ static struct git_pack_file *packfile_alloc(size_t extra)
}
-void packfile_free(struct git_pack_file *p)
+void git_packfile_free(struct git_pack_file *p)
{
assert(p);