Module: kamailio
Branch: master
Commit: c7f94fd94500270828fcc4cb3011c60c67a8936b
URL: 
https://github.com/kamailio/kamailio/commit/c7f94fd94500270828fcc4cb3011c60c67a8936b

Author: Charles Chance <charles.cha...@sipcentric.com>
Committer: Charles Chance <charles.cha...@sipcentric.com>
Date: 2015-08-28T07:58:13+01:00

dmq_usrloc: check existence of usrloc domain before continuing.

---

Modified: modules/dmq_usrloc/usrloc_sync.c

---

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

---

diff --git a/modules/dmq_usrloc/usrloc_sync.c b/modules/dmq_usrloc/usrloc_sync.c
index 172d188..06ef6b6 100644
--- a/modules/dmq_usrloc/usrloc_sync.c
+++ b/modules/dmq_usrloc/usrloc_sync.c
@@ -51,7 +51,10 @@ static int add_contact(str aor, ucontact_info_t* ci)
        str contact;
        int res;
 
-       dmq_ul.get_udomain("location", &_d);
+        if (dmq_ul.get_udomain("location", &_d) < 0) {
+                LM_ERR("Failed to get domain\n");
+                return -1;
+        }
        res = dmq_ul.get_urecord(_d, &aor, &r);
        if (res < 0) {
                LM_ERR("failed to retrieve record from usrloc\n");
@@ -98,7 +101,10 @@ static int delete_contact(str aor, ucontact_info_t* ci)
        urecord_t* r;
        ucontact_t* c;
 
-       dmq_ul.get_udomain("location", &_d);
+        if (dmq_ul.get_udomain("location", &_d) < 0) {
+                LM_ERR("Failed to get domain\n");
+                return -1;
+        }
 
        if (dmq_ul.get_urecord_by_ruid(_d, dmq_ul.get_aorhash(&aor),
                                &ci->ruid, &r, &c) != 0) {


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to