[sr-dev] git:master:cc9033be: tm: use standard shm malloc to store to-tag set

Daniel-Constantin Mierla miconda at gmail.com
Fri Aug 11 15:50:02 CEST 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-08-11T15:10:38+02:00

tm: use standard shm malloc to store to-tag set

---

Modified: src/modules/tm/t_reply.c

---

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

---

diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c
index 795da9cb14..c26b5eca32 100644
--- a/src/modules/tm/t_reply.c
+++ b/src/modules/tm/t_reply.c
@@ -306,10 +306,8 @@ inline static int update_totag_set(struct cell *t, struct sip_msg *ok)
 		}
 	}
 	/* that's a new to-tag -- record it */
-	shm_lock();
-	n=(struct totag_elem*) shm_malloc_unsafe(sizeof(struct totag_elem));
-	s=(char *)shm_malloc_unsafe(tag->len);
-	shm_unlock();
+	n=(struct totag_elem*) shm_malloc(sizeof(struct totag_elem));
+	s=(char *)shm_malloc(tag->len);
 	if (!s || !n) {
 		LM_ERR("no more shm memory \n");
 		if (n) shm_free(n);




More information about the sr-dev mailing list