From: Sean Bright Date: Fri, 27 Dec 2019 23:29:45 +0000 (-0500) Subject: db: Initialize condition primitive before use X-Git-Tag: 17.2.0-rc1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=843d601e2cf8d1a081fc1e229d3dbb67dd67e80f;p=thirdparty%2Fasterisk.git 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 --- 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; }