db: Initialize condition primitive before use

The db_init() function ultimately calls db_sync() which signals the
condition before it is initialized.

Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab
This commit is contained in:
Sean Bright 2019-12-27 18:29:45 -05:00
parent c6dc24fc8e
commit efa13eb0a0
1 changed files with 2 additions and 1 deletions

View File

@ -1081,11 +1081,12 @@ static void astdb_atexit(void)
int astdb_init(void)
{
ast_cond_init(&dbcond, NULL);
if (db_init()) {
return -1;
}
ast_cond_init(&dbcond, NULL);
if (ast_pthread_create_background(&syncthread, NULL, db_sync_thread, NULL)) {
return -1;
}