Module: kamailio
Branch: master
Commit: bb536c3dae01865c42e556989e8aca5be85b20fe
URL:
https://github.com/kamailio/kamailio/commit/bb536c3dae01865c42e556989e8aca5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
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/bb536c3dae01865c42e556989e8aca5…
Patch:
https://github.com/kamailio/kamailio/commit/bb536c3dae01865c42e556989e8aca5…
---
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)