From 401056fd278c40ea15e5d9c8f7bc2b30a2000526 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Fri, 27 Dec 2019 18:29:45 -0500 Subject: [PATCH] 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 --- main/db.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/db.c b/main/db.c index 4d1b37242d..193bd2e0de 100644 --- a/main/db.c +++ b/main/db.c @@ -1083,11 +1083,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; }