[sr-dev] git:master:5f5697ea: http_async_client: safety check for shm malloc and do cfg_update()

Daniel-Constantin Mierla miconda at gmail.com
Tue Aug 8 17:21:09 CEST 2017


Module: kamailio
Branch: master
Commit: 5f5697eac0089e9e2bc72323c6afa839b472ccbd
URL: https://github.com/kamailio/kamailio/commit/5f5697eac0089e9e2bc72323c6afa839b472ccbd

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-08-08T17:20:33+02:00

http_async_client: safety check for shm malloc and do cfg_update()

---

Modified: src/modules/http_async_client/async_http.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5f5697eac0089e9e2bc72323c6afa839b472ccbd.diff
Patch: https://github.com/kamailio/kamailio/commit/5f5697eac0089e9e2bc72323c6afa839b472ccbd.patch

---

diff --git a/src/modules/http_async_client/async_http.c b/src/modules/http_async_client/async_http.c
index 5c1d249ff3..5057908478 100644
--- a/src/modules/http_async_client/async_http.c
+++ b/src/modules/http_async_client/async_http.c
@@ -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);
 
@@ -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;




More information about the sr-dev mailing list