patch 8.1.2147: crash when allocating memory fails
Problem: Crash when allocating memory fails. (Zu-Ming Jiang)
Solution: Check that 'spellcapcheck' is not NULL. (closes #5048)
diff --git a/src/spell.c b/src/spell.c
index 607bb39..04e4af6 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -4367,7 +4367,7 @@
regprog_T *rp = synblock->b_cap_prog;
char_u *re;
- if (*synblock->b_p_spc == NUL)
+ if (synblock->b_p_spc == NULL || *synblock->b_p_spc == NUL)
synblock->b_cap_prog = NULL;
else
{
diff --git a/src/version.c b/src/version.c
index a6a9439..3dc64cc 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2147,
+/**/
2146,
/**/
2145,