Skip to content

Commit

Permalink
rls: proper handling of return code for parse from/to uri
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 12, 2017
1 parent 5be6d11 commit bb536c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/modules/rls/rls.c
Expand Up @@ -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;

}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/rls/subscribe.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bb536c3

Please sign in to comment.