Problem: attrs allocation and fuzzy growarray could leak on early
returns
Solution: Ensure proper cleanup of allocated memory on exit paths
(glepnir)
closes: #18038
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
static void
pum_compute_size(void)
{
- int i;
int w;
// Compute the width of the widest match and the widest extra.
pum_base_width = 0;
pum_kind_width = 0;
pum_extra_width = 0;
- for (i = 0; i < pum_size; ++i)
+ for (int i = 0; i < pum_size; ++i)
{
if (pum_array[i].pum_text != NULL)
{
leader_len = STRLEN(leader);
if (in_fuzzy)
+ {
ga = fuzzy_match_str_with_pos(text, leader);
+ if (!ga)
+ {
+ vim_free(attrs);
+ return NULL;
+ }
+ }
while (*ptr != NUL)
{
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1649,
/**/
1648,
/**/