diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c index f9ba84fbf74..6665e134021 100644 --- a/modules/dialog/dlg_db_handler.c +++ b/modules/dialog/dlg_db_handler.c @@ -627,6 +627,7 @@ static int load_dialog_info_from_db(int dlg_hash_size) } if(dlg->h_entry != hash_entry){ + dlg_unlock(d_table, d_entry); LM_ERR("inconsistent hash data in the dialog database: " "you may have restarted opensips using a different " "hash_size: please erase %.*s database and restart\n" @@ -670,6 +671,7 @@ static int load_dialog_info_from_db(int dlg_hash_size) LM_ERR("dlg_set_leg_info failed\n"); /* destroy the dialog */ unref_dlg_unsafe(dlg, 1, d_entry); + dlg_unlock(d_table, d_entry); continue; } dlg->legs_no[DLG_LEG_200OK] = DLG_FIRST_CALLEE_LEG; @@ -727,6 +729,7 @@ static int load_dialog_info_from_db(int dlg_hash_size) ZSW(dlg->legs[callee_idx(dlg)].tag.s)); /* destroy the dialog */ unref_dlg_unsafe(dlg, 1, d_entry); + dlg_unlock(d_table, d_entry); continue; }