mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval: Fix memory deallocation of JobEvent
This causes a "read after free" error when kmp_free is replaced by `free`.
This commit is contained in:
parent
0248c75bc1
commit
27b5ef3975
@ -20313,11 +20313,11 @@ static void on_job_event(Event event)
|
|||||||
clear_tv(&rettv);
|
clear_tv(&rettv);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
kmp_free(JobEventPool, job_event_pool, ev);
|
|
||||||
if (!ev->received) {
|
if (!ev->received) {
|
||||||
// exit event, safe to free job data now
|
// exit event, safe to free job data now
|
||||||
term_job_data_decref(ev->data);
|
term_job_data_decref(ev->data);
|
||||||
}
|
}
|
||||||
|
kmp_free(JobEventPool, job_event_pool, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void script_host_eval(char *name, typval_T *argvars, typval_T *rettv)
|
static void script_host_eval(char *name, typval_T *argvars, typval_T *rettv)
|
||||||
|
Loading…
Reference in New Issue
Block a user