api: fix use-after-free in nvim_chan_send

This commit is contained in:
Björn Linse
2021-03-23 20:09:36 +01:00
parent 8e496b9dfd
commit 3d6831a30a
4 changed files with 26 additions and 16 deletions

View File

@@ -916,7 +916,7 @@ static void f_chansend(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
uint64_t id = argvars[0].vval.v_number;
const char *error = NULL;
rettv->vval.v_number = channel_send(id, input, input_len, &error);
rettv->vval.v_number = channel_send(id, input, input_len, true, &error);
if (error) {
EMSG(error);
}