mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07: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);
|
||||
|
||||
end:
|
||||
kmp_free(JobEventPool, job_event_pool, ev);
|
||||
if (!ev->received) {
|
||||
// exit event, safe to free job data now
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user