aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/eval.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index b9768978e5..24502116f3 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -12887,15 +12887,16 @@ static void f_rpcstart(typval_T *argvars, typval_T *rettv)
}
}
+ if (argvars[0].vval.v_string == NULL || argvars[0].vval.v_string[0] == NUL) {
+ EMSG(_(e_api_spawn_failed));
+ return;
+ }
+
// Allocate extra memory for the argument vector and the NULL pointer
int argvl = argsl + 2;
char **argv = xmalloc(sizeof(char_u *) * argvl);
// Copy program name
- if (argvars[0].vval.v_string == NULL || argvars[0].vval.v_string[0] == NUL) {
- EMSG(_(e_api_spawn_failed));
- return;
- }
argv[0] = xstrdup((char *)argvars[0].vval.v_string);
int i = 1;