diff src/terminal.c @ 13250:fc33325c91c1 v8.0.1499

patch 8.0.1499: out-of-memory situation not correctly handled commit https://github.com/vim/vim/commit/4b7e7bed6cb16c8256e6973418701cfb15b30b8e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 11 14:53:30 2018 +0100 patch 8.0.1499: out-of-memory situation not correctly handled Problem: Out-of-memory situation not correctly handled. (Coverity) Solution: Check for NULL value.
author Christian Brabandt <cb@256bit.org>
date Sun, 11 Feb 2018 15:00:06 +0100
parents ac42c4b11dbc
children 8db0345053b9
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -3153,6 +3153,8 @@ f_term_scrape(typval_T *argvars, typval_
 	    bg = cell.bg;
 	}
 	dcell = dict_alloc();
+	if (dcell == NULL)
+	    break;
 	list_append_dict(l, dcell);
 
 	dict_add_nr_str(dcell, "chars", 0, mbs);