diff options
| author | Taylor Blau <me@ttaylorr.com> | 2026-05-11 20:47:12 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-05-12 10:36:18 +0900 |
| commit | 5e6e8dc7860374d79bad3e2a3ade0c2d391bbad6 (patch) | |
| tree | af7db4c7c1b8f51ae708acde6a2bca19c6f2bdbe /t/t4013/diff.diff_initial..side | |
| parent | 84780db63657057bee11d898ad6c211730d4212f (diff) | |
pack-bitmap: prevent pattern leak on pseudo-merge re-assignment
When "bitmapPseudoMerge.*.pattern" appears more than once for the same
group, `pseudo_merge_config()` frees the old `regex_t *` pointer
but does not call `regfree()` on it first. This leaks whatever internal
state `regcomp()` allocated.
The final cleanup path in `pseudo_merge_group_release()` does call
`regfree()` before `free()`, so only the intermediate replacement is
affected.
Fix this by guarding the replacement with a NULL check and calling
`regfree()` before `free()` when the pointer is non-NULL.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions
