mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
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 #10127)
This commit is contained in:
committed by
Bram Moolenaar
parent
5e1792270a
commit
7c7e19cf50
14
src/alloc.c
14
src/alloc.c
@@ -719,6 +719,20 @@ ga_grow(garray_T *gap, int n)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Same as ga_grow() but uses an allocation id for testing.
|
||||
*/
|
||||
int
|
||||
ga_grow_id(garray_T *gap, int n, alloc_id_T id UNUSED)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
if (alloc_fail_id == id && alloc_does_fail(sizeof(list_T)))
|
||||
return FAIL;
|
||||
#endif
|
||||
|
||||
return ga_grow(gap, n);
|
||||
}
|
||||
|
||||
int
|
||||
ga_grow_inner(garray_T *gap, int n)
|
||||
{
|
||||
|
Reference in New Issue
Block a user