Module: sip-router Branch: master Commit: 275c8a77b6f09aabf428d91c9c22ab5bcfce8d4e URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=275c8a77...
Author: Peter Dunkley peter.dunkley@crocodile-rcs.com Committer: Peter Dunkley peter.dunkley@crocodile-rcs.com Date: Fri May 4 18:21:47 2012 +0100
modules_k/rls: Added checks for NULL results from DB queries
---
modules_k/rls/notify.c | 6 ++++++ modules_k/rls/subscribe.c | 6 ++++++ 2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/modules_k/rls/notify.c b/modules_k/rls/notify.c index a460fa0..fd99b5a 100644 --- a/modules_k/rls/notify.c +++ b/modules_k/rls/notify.c @@ -1323,6 +1323,12 @@ int rls_get_resource_list(str *rl_uri, str *username, str *domain, return -1; }
+ if(result == NULL) + { + LM_ERR("bad result\n"); + return -1; + } + if(result->n<=0) { LM_DBG("No rl document found\n"); diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c index 3918849..7df5d40 100644 --- a/modules_k/rls/subscribe.c +++ b/modules_k/rls/subscribe.c @@ -177,6 +177,12 @@ int rls_get_service_list(str *service_uri, str *user, str *domain, return -1; }
+ if (result == NULL) + { + LM_ERR("bad result\n"); + return -1; + } + if(result->n<=0) { LM_DBG("No rl document found\n");