Skip to content

Commit

Permalink
http_async_client: safety check for shm malloc and do cfg_update()
Browse files Browse the repository at this point in the history
(cherry picked from commit 5f5697e)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent 3c6ad97 commit 2d13c14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/http_async_client/async_http.c
Expand Up @@ -70,6 +70,10 @@ int async_http_init_worker(int prank, async_http_worker_t* worker)
LM_DBG("base event %p created\n", worker->evbase);

worker->g = shm_malloc(sizeof(struct http_m_global));
if(worker->g==NULL) {
LM_ERR("out of shared memory\n");
return -1;
}
memset(worker->g, 0, sizeof(http_m_global_t));
LM_DBG("initialized global struct %p\n", worker->g);

Expand Down Expand Up @@ -189,6 +193,7 @@ void async_http_cb(struct http_m_reply *reply, void *param)
strncpy(q_id, aq->id, strlen(aq->id));

act = (cfg_action_t*)aq->param;
cfg_update();

if (aq->query_params.suspend_transaction) {
tindex = aq->tindex;
Expand Down

0 comments on commit 2d13c14

Please sign in to comment.