]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1628: fuzzy.c has a few issues v9.1.1628
authorglepnir <glephunter@gmail.com>
Wed, 13 Aug 2025 20:02:30 +0000 (22:02 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 13 Aug 2025 20:02:30 +0000 (22:02 +0200)
commit17a6d696bd2f9526f2c4beae95208626d0e8d922
tree9cf2af8abfd8246bb2708de42a1aad15bdab06b3
parentc93a2b332734086ef94c4abf407f584e1e41bd55
patch 9.1.1628: fuzzy.c has a few issues

Problem:  fuzzy.c has a few issues
Solution: Use Vims memory management, update style
          (glepnir)

Problem:
- Missing cleanup of lmatchpos lists causing memory leaks
- Missing error handling for list operations
- Use of malloc() instead of Vim's alloc() functions
- Inconsistent C-style comments
- Missing null pointer checks for memory allocation
- Incorrect use of vim_free() for list objects

Solution:
- Add proper cleanup of lmatchpos in done section using list_free()
- Set lmatchpos to NULL after successful transfer to avoid confusion
- Add error handling for list_append_tv() failures
- Replace malloc() with alloc() and add null pointer checks
- Convert C-style comments to C++ style for consistency
- Fix vim_free() calls to use list_free() for list objects

closes: #17984

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/fuzzy.c
src/version.c