Module: sip-router Branch: master Commit: 9e7f627c5e9a4c34193e4662fbe341b70fa308bf URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9e7f627c...
Author: Jason Penton jason.penton@smilecoms.com Committer: Jason Penton jason.penton@smilecoms.com Date: Tue Apr 2 19:44:46 2013 +0200
modules/dialog_ng: bug fix for concurrent dialog did generation - spotted by Camille @ Orange - tks!
---
modules/dialog_ng/dlg_hash.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/dialog_ng/dlg_hash.c b/modules/dialog_ng/dlg_hash.c index 97e1371..51f8eec 100644 --- a/modules/dialog_ng/dlg_hash.c +++ b/modules/dialog_ng/dlg_hash.c @@ -1268,12 +1268,13 @@ int dlg_set_toroute(struct dlg_cell *dlg, str * route) { */ void create_concurrent_did(struct dlg_cell *dlg, str * new_did) { int len = dlg->did.len + 1; - new_did = shm_malloc(len); - if (new_did == 0) { + new_did->s = shm_malloc(len); + if (new_did->s == 0) { LM_ERR("no more shm mem (%d)\n", len); + return; } memcpy(new_did->s, dlg->did.s, dlg->did.len); - new_did->s[dlg->did.len+1]= 'x'; + new_did->s[len]= 'x'; new_did->len = len; }