Browse code

permissions: check for db_url being set on reload

Armen Babikyan authored on 08/08/2018 20:46:46 • Henning Westerholt committed on 15/08/2018 07:04:30
Showing 2 changed files
... ...
@@ -255,6 +255,11 @@ dberror:
255 255
  */
256 256
 int reload_address_table_cmd(void)
257 257
 {
258
+	if(!db_url.s) {
259
+		LM_ERR("db_url not set\n");
260
+		return -1;
261
+	}
262
+
258 263
 	if (!db_handle) {
259 264
 		db_handle = perm_dbf.init(&db_url);
260 265
 		if (!db_handle) {
... ...
@@ -621,4 +626,4 @@ int allow_address_group(struct sip_msg* _msg, char* _addr, char* _port)
621 626
 	}
622 627
 
623 628
 	return ki_allow_address_group(_msg, &ips, port);
624
-}
625 629
\ No newline at end of file
630
+}
... ...
@@ -636,6 +636,11 @@ int allow_trusted_3(struct sip_msg* _msg, char* _src_ip_sp, char* _proto_sp,
636 636
 
637 637
 int reload_trusted_table_cmd(void)
638 638
 {
639
+	if(!db_url.s) {
640
+		LM_ERR("db_url not set\n");
641
+		return -1;
642
+	}
643
+
639 644
 	if (!db_handle) {
640 645
 		db_handle = perm_dbf.init(&db_url);
641 646
 		if (!db_handle) {