git:master:bb536c3d: rls: proper handling of return code for parse from/to uri

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

git:master:bb536c3d: rls: proper handling of return code for parse from/to uri

Daniel-Constantin Mierla-6
Module: kamailio
Branch: master
Commit: bb536c3dae01865c42e556989e8aca5be85b20fe
URL: https://github.com/kamailio/kamailio/commit/bb536c3dae01865c42e556989e8aca5be85b20fe

Author: Daniel-Constantin Mierla <[hidden email]>
Committer: Daniel-Constantin Mierla <[hidden email]>
Date: 2017-08-12T08:48:21+02:00

rls: proper handling of return code for parse from/to uri

---

Modified: src/modules/rls/rls.c
Modified: src/modules/rls/subscribe.c

---

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

---

diff --git a/src/modules/rls/rls.c b/src/modules/rls/rls.c
index 86f9bf3c9f..d16d3a24a4 100644
--- a/src/modules/rls/rls.c
+++ b/src/modules/rls/rls.c
@@ -1023,8 +1023,7 @@ int rls_restore_db_subs(void)
  return 0;
 
 error:
- if(res)
- rls_dbf.free_result(rls_db, res);
+ rls_dbf.free_result(rls_db, res);
  return -1;
 
 }
diff --git a/src/modules/rls/subscribe.c b/src/modules/rls/subscribe.c
index 6ce59d58e3..b08e55e6f2 100644
--- a/src/modules/rls/subscribe.c
+++ b/src/modules/rls/subscribe.c
@@ -440,7 +440,7 @@ int rls_handle_subscribe0(struct sip_msg* msg)
 {
  struct to_body *pfrom;
 
- if (parse_from_uri(msg) < 0)
+ if (parse_from_uri(msg) == NULL)
  {
  LM_ERR("failed to find From header\n");
  if (slb.freply(msg, 400, &pu_400_rpl) < 0)
@@ -507,7 +507,7 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
  return 0;
  }
  /* check for To and From headesr */
- if(parse_to_uri(msg)<0 || parse_from_uri(msg)<0)
+ if(parse_to_uri(msg)==NULL || parse_from_uri(msg)==NULL)
  {
  LM_ERR("failed to find To or From headers\n");
  if (slb.freply(msg, 400, &pu_400_rpl) < 0)


_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Loading...