summaryrefslogtreecommitdiff
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-06 15:14:45 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-06 15:14:45 +0200
commit8a0dcf43305586853f452a77fa295b0c8d54b463 (patch)
treeccf2c0ebb8744b84c55ca4c199f4d56708b6f7d6 /src/regexp.c
parent4140c4f3fff1a441f2837f2f911ab0f0368e412a (diff)
downloadvim-git-8a0dcf43305586853f452a77fa295b0c8d54b463.tar.gz
patch 8.2.1621: crash when using submatch(0, 1) in substitute()v8.2.1621
Problem: Crash when using submatch(0, 1) in substitute(). Solution: Increment reference count. (closes #6887)
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 229f6ef2b..375731c3c 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -2543,6 +2543,7 @@ reg_submatch_list(int no)
list_free(list);
return NULL;
}
+ ++list->lv_refcount;
return list;
}
#endif