changeset 17907:4cf69f8d1ec6 v8.1.1950

patch 8.1.1950: using NULL pointer after an out-of-memory Commit: https://github.com/vim/vim/commit/4bbfb0f3cc67c00c8cee4e47283e8d760025219d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 31 15:28:02 2019 +0200 patch 8.1.1950: using NULL pointer after an out-of-memory Problem: Using NULL pointer after an out-of-memory. Solution: Check for NULL pointer. (Dominique Pelle, closes https://github.com/vim/vim/issues/4881)
author Bram Moolenaar <Bram@vim.org>
date Sat, 31 Aug 2019 15:30:04 +0200
parents b70e65826005
children d9ada976a4c0
files src/syntax.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -5222,7 +5222,7 @@ syn_cmd_region(
     for (item = ITEM_START; item <= ITEM_END; ++item)
 	for (ppp = pat_ptrs[item]; ppp != NULL; ppp = ppp_next)
 	{
-	    if (!success)
+	    if (!success && ppp->pp_synp != NULL)
 	    {
 		vim_regfree(ppp->pp_synp->sp_prog);
 		vim_free(ppp->pp_synp->sp_pattern);
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1950,
+/**/
     1949,
 /**/
     1948,