vim-patch:8.2.1162: crash when using a lambda

Problem:    Crash when using a lambda.
Solution:   Check for evalarg to be NULL.

efaaaa683b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq 2023-04-14 15:24:57 +08:00
parent cc7a50a9ae
commit c804c7df0c

View File

@ -366,7 +366,7 @@ int get_lambda_tv(char **arg, typval_T *rettv, evalarg_T *evalarg)
}
eval_lavars_used = old_eval_lavars;
if (evalarg->eval_tofree == NULL) {
if (evalarg != NULL && evalarg->eval_tofree == NULL) {
evalarg->eval_tofree = tofree;
} else {
xfree(tofree);
@ -377,7 +377,7 @@ errret:
ga_clear_strings(&newargs);
xfree(fp);
xfree(pt);
if (evalarg->eval_tofree == NULL) {
if (evalarg != NULL && evalarg->eval_tofree == NULL) {
evalarg->eval_tofree = tofree;
} else {
xfree(tofree);