Skip to content

Commit bbbe695

Browse files
committed
db_virtual: check NULL before log
1 parent 590a19f commit bbbe695

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/db_virtual/dbase.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@ db_con_t* db_virtual_init(const str* _set_url)
281281
allocate
282282
populate with db_init
283283
*/
284+
if(!_set_url || !_set_url->s){
285+
LM_ERR("url or url.s NULL\n");
286+
return NULL;
287+
}
288+
284289
LM_DBG("INIT set_name, %.*s\n", _set_url->len, _set_url->s);
285290

286291
int i;
@@ -290,11 +295,6 @@ db_con_t* db_virtual_init(const str* _set_url)
290295
char * token;
291296
handle_set_t* p;
292297

293-
if(!_set_url || !_set_url->s){
294-
LM_ERR("url or url.s NULL\n");
295-
return NULL;
296-
}
297-
298298
/* so that loadmodule order does not matter */
299299
if(!global){
300300
if(virtual_mod_init())

0 commit comments

Comments
 (0)