summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-01 12:41:06 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-01 08:47:37 -0700
commit1f0899978109d732abe5b4825b5cfa40ef1d5885 (patch)
tree097f65a52a9e9e6878970618b6199c626eda3ee4 /commit.h
parent57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9 (diff)
entry: fix leaking pathnames during delayed checkout
When filtering files during delayed checkout, we pass a string list to `async_query_available_blobs()`. This list is initialized with NODUP, and thus inserted strings will not be owned by the list. In the latter function we then try to hand over ownership by passing an `xstrup()`'d value to `string_list_insert()`. But this is not how this works: a NODUP list does not take ownership of allocated strings and will never free them for the caller. Fix this issue by initializing the list as `DUP` instead and dropping the explicit call to `xstrdup()`. This is okay to do given that this is the single callsite of `async_query_available_blobs()`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions