summaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-24 21:54:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-24 21:54:30 (GMT)
commitff20794402177adc52cab849b98fc85f3c2da739 (patch)
treed1feaa58edb34788e38ba0cbef3b4e2018ab4614 /midx.c
parent11f433f79c790bcb5feae71b0320161d7ab7dea7 (diff)
parent3e19816dc044a4aca4a15276c92f804c44d0f65f (diff)
downloadgit-ff20794402177adc52cab849b98fc85f3c2da739.zip
git-ff20794402177adc52cab849b98fc85f3c2da739.tar.gz
git-ff20794402177adc52cab849b98fc85f3c2da739.tar.bz2
Merge branch 'jk/unleak-fixes'
Fix some incorrect UNLEAK() annotations. * jk/unleak-fixes: ls-remote: simplify UNLEAK() usage stop calling UNLEAK() before die()
Diffstat (limited to 'midx.c')
-rw-r--r--midx.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/midx.c b/midx.c
index df33fac..e046d03 100644
--- a/midx.c
+++ b/midx.c
@@ -821,11 +821,9 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
int result = 0;
midx_name = get_midx_filename(object_dir);
- if (safe_create_leading_directories(midx_name)) {
- UNLEAK(midx_name);
+ if (safe_create_leading_directories(midx_name))
die_errno(_("unable to create leading directories of %s"),
midx_name);
- }
if (m)
packs.m = m;
@@ -1065,10 +1063,8 @@ void clear_midx_file(struct repository *r)
r->objects->multi_pack_index = NULL;
}
- if (remove_path(midx)) {
- UNLEAK(midx);
+ if (remove_path(midx))
die(_("failed to clear multi-pack-index at %s"), midx);
- }
free(midx);
}