vim-patch:8.2.0033: make_extmatch() OOM #11602

Problem:    Crash when make_extmatch() runs out of memory.
Solution:   Check for NULL. (Dominique Pelle, closs vim/vim#5392)
7c77b34967
This commit is contained in:
Jan Edmund Lazo 2019-12-24 00:40:39 -05:00 committed by Justin M. Keyes
parent 2ef72437fc
commit 7dacab9afd
1 changed files with 1 additions and 0 deletions

View File

@ -3575,6 +3575,7 @@ theend:
* Create a new extmatch and mark it as referenced once.
*/
static reg_extmatch_T *make_extmatch(void)
FUNC_ATTR_NONNULL_RET
{
reg_extmatch_T *em = xcalloc(1, sizeof(reg_extmatch_T));
em->refcnt = 1;