Skip to content

Commit

Permalink
set async ctx to 0
Browse files Browse the repository at this point in the history
prevent crash in timeout_f not being set but reactor still somehow timing out fds
  • Loading branch information
vladpaiu committed Jul 17, 2023
1 parent d952c6f commit cfcd9a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions async.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ int register_async_fd(int fd, async_resume_fd *f, void *resume_param)
return -1;
}

memset(ctx,0,sizeof(async_ctx));

ctx->resume_f = f;
ctx->resume_param = resume_param;

Expand Down Expand Up @@ -298,6 +300,8 @@ int async_script_launch(struct sip_msg *msg, struct action* a,
return -1;
}

memset(ctx,0,sizeof(async_launch_ctx));

async_status = ASYNC_NO_IO; /*assume defauly status "no IO done" */

return_code = ((const acmd_export_t*)(a->elem[0].u.data_const))->function(msg,
Expand Down
2 changes: 2 additions & 0 deletions modules/tm/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ int t_handle_async(struct sip_msg *msg, struct action* a,
goto failure;
}

memset(ctx,0,sizeof(async_tm_ctx));

async_status = ASYNC_NO_IO; /*assume default status "no IO done" */
return_code = ((const acmd_export_t*)(a->elem[0].u.data_const))->function(msg,
(async_ctx*)ctx,
Expand Down

0 comments on commit cfcd9a6

Please sign in to comment.