aboutsummaryrefslogtreecommitdiffstats
path: root/sparse-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-11-13 08:35:30 +0900
committerJunio C Hamano <gitster@pobox.com>2024-11-13 08:35:31 +0900
commit6890c99e38c378c2fff7747b52bd2102b403357d (patch)
tree98d69bfd5256984c561ee7f3832ba04a283863ae /sparse-index.c
parentMerge https://github.com/j6t/git-gui (diff)
parentlist-objects-filter-options: work around reported leak on error (diff)
downloadgit-6890c99e38c378c2fff7747b52bd2102b403357d.tar.gz
git-6890c99e38c378c2fff7747b52bd2102b403357d.zip
Merge branch 'ps/leakfixes-part-9'
More leakfixes. * ps/leakfixes-part-9: (22 commits) list-objects-filter-options: work around reported leak on error builtin/merge: release output buffer after performing merge dir: fix leak when parsing "status.showUntrackedFiles" t/helper: fix leaking buffer in "dump-untracked-cache" t/helper: stop re-initialization of `the_repository` sparse-index: correctly free EWAH contents dir: release untracked cache data combine-diff: fix leaking lost lines builtin/tag: fix leaking key ID on failure to sign transport-helper: fix leaking import/export marks builtin/commit: fix leaking cleanup config trailer: fix leaking strbufs when formatting trailers trailer: fix leaking trailer values builtin/commit: fix leaking change data contents upload-pack: fix leaking URI protocols pretty: clear signature check diff-lib: fix leaking diffopts in `do_diff_cache()` revision: fix leaking bloom filters builtin/grep: fix leak with `--max-count=0` grep: fix leak in `grep_splice_or()` ...
Diffstat (limited to 'sparse-index.c')
-rw-r--r--sparse-index.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sparse-index.c b/sparse-index.c
index 3d7f2164e2..2107840bfc 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -2,6 +2,7 @@
#include "git-compat-util.h"
#include "environment.h"
+#include "ewah/ewok.h"
#include "gettext.h"
#include "name-hash.h"
#include "read-cache-ll.h"
@@ -242,7 +243,8 @@ int convert_to_sparse(struct index_state *istate, int flags)
cache_tree_update(istate, 0);
istate->fsmonitor_has_run_once = 0;
- FREE_AND_NULL(istate->fsmonitor_dirty);
+ ewah_free(istate->fsmonitor_dirty);
+ istate->fsmonitor_dirty = NULL;
FREE_AND_NULL(istate->fsmonitor_last_update);
istate->sparse_index = INDEX_COLLAPSED;
@@ -438,7 +440,8 @@ void expand_index(struct index_state *istate, struct pattern_list *pl)
istate->cache_nr = full->cache_nr;
istate->cache_alloc = full->cache_alloc;
istate->fsmonitor_has_run_once = 0;
- FREE_AND_NULL(istate->fsmonitor_dirty);
+ ewah_free(istate->fsmonitor_dirty);
+ istate->fsmonitor_dirty = NULL;
FREE_AND_NULL(istate->fsmonitor_last_update);
strbuf_release(&base);