vim-patch:8.1.1950: using NULL pointer after an out-of-memory (#10902)

Problem:    Using NULL pointer after an out-of-memory.
Solution:   Check for NULL pointer. (Dominique Pelle, closes vim/vim#4881)
4bbfb0f3cc
This commit is contained in:
Jan Edmund Lazo 2019-08-31 15:34:26 -04:00 committed by Daniel Hahler
parent 25e0a449bb
commit e29b89ca54

View File

@ -4683,7 +4683,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);
xfree(ppp->pp_synp->sp_pattern);
}