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