Patch 8.1.1186
Problem: readdir() allocates list twice.
Solution: Remove second allocation. Also check for zero length.
Files: src/evalfunc.c
*** ../vim-8.1.1185/src/evalfunc.c 2019-04-08 20:01:42.877179442 +0200
--- src/evalfunc.c 2019-04-19 15:20:22.221545619 +0200
***************
*** 9324,9333 ****
}
#endif
! rettv->vval.v_list = list_alloc();
! if (!failed && rettv->vval.v_list != NULL)
{
- ++rettv->vval.v_list->lv_refcount;
sort_strings((char_u **)ga.ga_data, ga.ga_len);
for (i = 0; i < ga.ga_len; i++)
{
--- 9324,9331 ----
}
#endif
! if (!failed && rettv->vval.v_list != NULL && ga.ga_len > 0)
{
sort_strings((char_u **)ga.ga_data, ga.ga_len);
for (i = 0; i < ga.ga_len; i++)
{
***************
*** 9335,9344 ****
list_append_string(rettv->vval.v_list, p, -1);
}
}
! for (i = 0; i < ga.ga_len; i++)
! vim_free(((char_u **)ga.ga_data)[i]);
!
! ga_clear(&ga);
}
/*
--- 9333,9339 ----
list_append_string(rettv->vval.v_list, p, -1);
}
}
! ga_clear_strings(&ga);
}
/*
*** ../vim-8.1.1185/src/version.c 2019-04-18 21:08:46.841176544 +0200
--- src/version.c 2019-04-19 15:19:45.857716573 +0200
***************
*** 773,774 ****
--- 773,776 ----
{ /* Add new patch number below this line */
+ /**/
+ 1186,
/**/
--
"Intelligence has much less practical application than you'd think."
-- Scott Adams, Dilbert.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.