tsilo: check return code for parse_uri()
authorDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 20 Jul 2017 18:34:57 +0000 (20:34 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 20 Jul 2017 18:34:57 +0000 (20:34 +0200)
src/modules/tsilo/ts_append.c

index 0076634..e6e27e4 100644 (file)
@@ -50,9 +50,12 @@ int ts_append(struct sip_msg* msg, str *ruri, char *table) {
 
        if (use_domain) {
                t_uri = ruri;
-       }
-       else {
-               parse_uri(ruri->s, ruri->len, &p_uri);
+       } else {
+               if(parse_uri(ruri->s, ruri->len, &p_uri)<0) {
+                       LM_ERR("failed to parse uri %.*s\n", ruri->len, ruri->s);
+                       unlock_entry_by_ruri(ruri);
+                       return -1;
+               }
                t_uri = &p_uri.user;
        }