summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-06-27 09:19:59 -0700
committerJunio C Hamano <gitster@pobox.com>2024-06-27 09:19:59 -0700
commitb781a3e08eb0db24fbc966df7c5b6c266c3683af (patch)
tree1306f01b72469f13120e7d47f952555c4a6860c7 /fetch-pack.c
parent5dce36e04fb61bb4c696336f94fa3db62a559695 (diff)
parent96a6621d256dc39a561913f5aadd1605ba33f161 (diff)
Merge branch 'jk/fetch-pack-fsck-wo-lock-pack'
"git fetch-pack -k -k" without passing "--lock-pack" (which we never do ourselves) did not work at all, which has been corrected. * jk/fetch-pack-fsck-wo-lock-pack: fetch-pack: fix segfault when fscking without --lock-pack
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index eba9e420ea..42f48fbc31 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1038,8 +1038,10 @@ static int get_pack(struct fetch_pack_args *args,
if (!is_well_formed)
die(_("fetch-pack: invalid index-pack output"));
- if (pack_lockfile)
+ if (pack_lockfiles && pack_lockfile)
string_list_append_nodup(pack_lockfiles, pack_lockfile);
+ else
+ free(pack_lockfile);
parse_gitmodules_oids(cmd.out, gitmodules_oids);
close(cmd.out);
}