diff src/userfunc.c @ 28382:f24d4826e6bf v8.2.4716

patch 8.2.4716: memory allocation failure not tested when defining a function Commit: https://github.com/vim/vim/commit/7c7e19cf50d76568e2637ad66b095044a41c6a82 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Apr 9 11:09:07 2022 +0100 patch 8.2.4716: memory allocation failure not tested when defining a function Problem: Memory allocation failure not tested when defining a function. Solution: Add a test. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/10127)
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Apr 2022 12:15:02 +0200
parents b418e073b42f
children 769599ee9f06
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1092,7 +1092,7 @@ get_function_body(
 	}
 
 	// Add the line to the function.
-	if (ga_grow(newlines, 1 + sourcing_lnum_off) == FAIL)
+	if (ga_grow_id(newlines, 1 + sourcing_lnum_off, aid_get_func) == FAIL)
 	    goto theend;
 
 	if (heredoc_concat_len > 0)