From 843d601e2cf8d1a081fc1e229d3dbb67dd67e80f 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 e74c46bd7c..d4479f4e5a 100644 --- a/main/db.c +++ b/main/db.c @@ -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; } -- 2.47.2