Browse code

dmq_usrloc: check existence of usrloc domain before continuing.

Charles Chance authored on 28/08/2015 06:58:13
Showing 1 changed files
... ...
@@ -51,7 +51,10 @@ static int add_contact(str aor, ucontact_info_t* ci)
51 51
 	str contact;
52 52
 	int res;
53 53
 
54
-	dmq_ul.get_udomain("location", &_d);
54
+        if (dmq_ul.get_udomain("location", &_d) < 0) {
55
+                LM_ERR("Failed to get domain\n");
56
+                return -1;
57
+        }
55 58
 	res = dmq_ul.get_urecord(_d, &aor, &r);
56 59
 	if (res < 0) {
57 60
 		LM_ERR("failed to retrieve record from usrloc\n");
... ...
@@ -98,7 +101,10 @@ static int delete_contact(str aor, ucontact_info_t* ci)
98 101
 	urecord_t* r;
99 102
 	ucontact_t* c;
100 103
 
101
-	dmq_ul.get_udomain("location", &_d);
104
+        if (dmq_ul.get_udomain("location", &_d) < 0) {
105
+                LM_ERR("Failed to get domain\n");
106
+                return -1;
107
+        }
102 108
 
103 109
 	if (dmq_ul.get_urecord_by_ruid(_d, dmq_ul.get_aorhash(&aor),
104 110
 				&ci->ruid, &r, &c) != 0) {