diff src/ops.c @ 13254:88cc06dc1a50 v8.0.1501

patch 8.0.1501: out-of-memory situation not correctly handled commit https://github.com/vim/vim/commit/a0221df149aa3773450b3f930299a409dd75bd5b Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 11 15:07:22 2018 +0100 patch 8.0.1501: 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:15:06 +0100
parents ac42c4b11dbc
children 69517d67421f
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -1668,6 +1668,8 @@ yank_do_autocmd(oparg_T *oap, yankreg_T 
     v_event = get_vim_var_dict(VV_EVENT);
 
     list = list_alloc();
+    if (list == NULL)
+	return;
     for (n = 0; n < reg->y_size; n++)
 	list_append_string(list, reg->y_array[n], -1);
     list->lv_lock = VAR_FIXED;