Module: sip-router Branch: 3.3 Commit: a897251aaa545c8726587412009f4906ff21e2aa URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a897251a...
Author: Peter Dunkley peter.dunkley@crocodile-rcs.com Committer: Peter Dunkley peter.dunkley@crocodile-rcs.com Date: Thu Jul 12 21:48:08 2012 +0100
modules/sl: Fixed segmentation fault and corrected log messages
- Fixes by Hugh Waite @ Crocodile RCS (cherry picked from commit e78ff34f1ecfe9a60a52996126032ea04fb490ab)
---
modules/sl/sl.c | 4 ++-- modules/sl/sl_funcs.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/sl/sl.c b/modules/sl/sl.c index 2ca7592..eedb953 100644 --- a/modules/sl/sl.c +++ b/modules/sl/sl.c @@ -209,7 +209,7 @@ static int w_sl_send_reply(struct sip_msg* msg, char* p1, char* p2) }
if (get_str_fparam(&reason, msg, (fparam_t*)p2) < 0) { - reason = default_reason;; + reason = default_reason; }
if(reason.s[reason.len-1]=='\0') { @@ -219,7 +219,7 @@ static int w_sl_send_reply(struct sip_msg* msg, char* p1, char* p2) if (r == NULL) r = default_reason.s; } ret = sl_send_reply(msg, code, r); - if (r!=reason.s) pkg_free(r); + if ((r!=reason.s) && (r!=default_reason.s)) pkg_free(r); return ret; }
diff --git a/modules/sl/sl_funcs.c b/modules/sl/sl_funcs.c index 18d4217..388f79c 100644 --- a/modules/sl/sl_funcs.c +++ b/modules/sl/sl_funcs.c @@ -183,7 +183,7 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag) } if (!buf.s) { - DBG("DEBUG: sl_send_reply: response building failed\n"); + DBG("DEBUG: sl_reply_helper: response building failed\n"); goto error; }