mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
exec_later: use mem_calloc instead of calloc
Before this change, exec_later allocates memory for the struct exec_mailcap structure using calloc. However, the memory is freed in exec_mailcap_command using mem_free. Change exec_later to use mem_calloc instead of calloc. Unless CONFIG_FASTMEM is used, mem_free expects to find debugging metadata that only the mem_alloc family of functions store, and thus using mem_free on the memory allocated using calloc causes a crash.
This commit is contained in:
parent
c74ddb29c5
commit
e37caa01ec
@ -395,7 +395,7 @@ exec_mailcap_command(void *data)
|
||||
static void
|
||||
exec_later(struct session *ses, unsigned char *handler, unsigned char *file)
|
||||
{
|
||||
struct exec_mailcap *exec_mailcap = calloc(1, sizeof(*exec_mailcap));
|
||||
struct exec_mailcap *exec_mailcap = mem_calloc(1, sizeof(*exec_mailcap));
|
||||
|
||||
if (exec_mailcap) {
|
||||
exec_mailcap->ses = ses;
|
||||
|
Loading…
Reference in New Issue
Block a user