summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-31 15:28:02 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-31 15:28:02 +0200
commit4bbfb0f3cc67c00c8cee4e47283e8d760025219d (patch)
tree458dc0642fa899af644ca8e4987b0d70913234b4 /src/syntax.c
parent8c6173c7d3431dd8bc2b6ffc076ef49512a7e175 (diff)
downloadvim-git-4bbfb0f3cc67c00c8cee4e47283e8d760025219d.tar.gz
patch 8.1.1950: using NULL pointer after an out-of-memoryv8.1.1950
Problem: Using NULL pointer after an out-of-memory. Solution: Check for NULL pointer. (Dominique Pelle, closes #4881)
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 154b75954..2141beeaf 100644
--- 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);