patch 8.2.1991: Coverity warns for not using the ga_grow() return value
Problem: Coverity warns for not using the ga_grow() return value.
Solution: Bail out if ga_grow() fails. (Yegappan Lakshmanan, closes #7303)
diff --git a/src/getchar.c b/src/getchar.c
index 3d73a6c..165a6a3 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3645,7 +3645,11 @@
got_int = FALSE;
while (c1 != NUL && !aborted)
{
- ga_grow(&line_ga, 32);
+ if (ga_grow(&line_ga, 32) != OK)
+ {
+ aborted = TRUE;
+ break;
+ }
if (vgetorpeek(FALSE) == NUL)
{