patch 8.2.0166: Coverity warning for using uninitialized variable
Problem: Coverity warning for using uninitialized variable.
Solution: Check for failure.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index f8efa1d..001d274 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -570,7 +570,12 @@
if (ga_grow(&ectx.ec_stack, 1) == FAIL)
goto failed;
- get_env_tv(&name, &optval, TRUE);
+ if (get_env_tv(&name, &optval, TRUE) == FAIL)
+ {
+ semsg(_("E1060: Invalid environment variable name: %s"),
+ iptr->isn_arg.string);
+ goto failed;
+ }
*STACK_TV_BOT(0) = optval;
++ectx.ec_stack.ga_len;
}