summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-09 17:30:04 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-09 17:30:04 +0200
commitdcf59c37d0e1517439c4c0c4a6a5ca09c90157ad (patch)
tree5b5940468c0efa43794632435c9aa1bc1f283456
parenta45551a53557dba98973fdb3ff737dea2fffcda3 (diff)
downloadvim-git-8.2.0937.tar.gz
patch 8.2.0937: asan failure in the flatten() testv8.2.0937
Problem: Asan failure in the flatten() test. Solution: Free the flattened list.
-rw-r--r--src/list.c4
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/list.c b/src/list.c
index de802e6cf..675cf4283 100644
--- a/src/list.c
+++ b/src/list.c
@@ -739,6 +739,7 @@ list_insert(list_T *l, listitem_T *ni, listitem_T *item)
list_flatten(list_T *list, long maxdepth)
{
listitem_T *item;
+ listitem_T *tofree;
int n;
if (maxdepth == 0)
@@ -760,11 +761,14 @@ list_flatten(list_T *list, long maxdepth)
vimlist_remove(list, item, item);
if (list_extend(list, item->li_tv.vval.v_list, next) == FAIL)
return FAIL;
+ clear_tv(&item->li_tv);
+ tofree = item;
if (item->li_prev == NULL)
item = list->lv_first;
else
item = item->li_prev->li_next;
+ list_free_item(list, tofree);
if (++n >= maxdepth)
{
diff --git a/src/version.c b/src/version.c
index 37a43aafb..922ab4605 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 937,
+/**/
936,
/**/
935,