patch 9.2.0309: Missing out-of-memory check to may_get_cmd_block()

Problem:  Missing out-of-memory check to may_get_cmd_block()
Solution: Return p unchanged in case of out-of-memory (John Marriott)

closes: #19906

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
John Marriott
2026-04-06 13:07:31 +00:00
committed by Christian Brabandt
parent f1dbca200c
commit 4368ad34df
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -1240,6 +1240,8 @@ may_get_cmd_block(exarg_T *eap, char_u *p, char_u **tofree, int *flags)
}
vim_free(line);
retp = *tofree = ga_concat_strings(&ga, "\n");
if (retp == NULL)
retp = p;
ga_clear_strings(&ga);
*flags |= UC_VIM9;
}
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
309,
/**/
308,
/**/