Skip to content

Commit d121a7d

Browse files
peffgitster
authored andcommitted
fetch-pack: clear pack lockfiles list
If the --lock-pack option is passed (which it typically is when fetch-pack is used under the hood by smart-http), then we may end up with entries in our pack_lockfiles string_list. We need to clear them before returning to avoid a leak. In git-fetch this isn't a problem, since the same cleanup happens via transport_unlock_pack(). But the leak is detectable in t5551, which does http fetches. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ea47803 commit d121a7d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/fetch-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,5 +295,6 @@ int cmd_fetch_pack(int argc,
295295
free_refs(remote_refs);
296296
list_objects_filter_release(&args.filter_options);
297297
oid_array_clear(&shallow);
298+
string_list_clear(&pack_lockfiles, 0);
298299
return ret;
299300
}

0 commit comments

Comments
 (0)