modules/sl: Fixed segmentation fault and corrected log messages
authorPeter Dunkley <peter.dunkley@crocodile-rcs.com>
Thu, 12 Jul 2012 20:48:08 +0000 (21:48 +0100)
committerPeter Dunkley <peter.dunkley@crocodile-rcs.com>
Thu, 12 Jul 2012 20:48:08 +0000 (21:48 +0100)
- Fixes by Hugh Waite @ Crocodile RCS

modules/sl/sl.c
modules/sl/sl_funcs.c

index 2ca7592..eedb953 100644 (file)
@@ -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;
 }
 
index 18d4217..388f79c 100644 (file)
@@ -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;
        }