]> git.ipfire.org Git - thirdparty/git.git/commitdiff
midx: don't free midx_name early
authorTaylor Blau <me@ttaylorr.com>
Tue, 30 Mar 2021 15:04:14 +0000 (11:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Apr 2021 20:07:37 +0000 (13:07 -0700)
A subsequent patch will need to refer back to 'midx_name' later on in
the function. In fact, this variable is already free()'d later on, so
this makes the later free() no longer redundant.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c

diff --git a/midx.c b/midx.c
index b8f42bf31e48cfd84b411241446cd6ce40c2fc8a..25bfb335cac16d4861a9ab1671f362981e8bc58e 100644 (file)
--- a/midx.c
+++ b/midx.c
@@ -956,7 +956,6 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
 
        hold_lock_file_for_update(&lk, midx_name, LOCK_DIE_ON_ERROR);
        f = hashfd(get_lock_file_fd(&lk), get_lock_file_path(&lk));
-       FREE_AND_NULL(midx_name);
 
        if (ctx.m)
                close_midx(ctx.m);