X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=keydb_dynamic.c;h=ef42fbe35406977deb152610eceab0032bda850c;hb=1a9c2d7545a4bafd7a601a8983192c4861d89c68;hp=25a359aa9ecb548b2d25159c6ac474a5c623c543;hpb=1ec1e2efdf4092233ac2136dff5a35cf6c7f4710;p=onak.git diff --git a/keydb_dynamic.c b/keydb_dynamic.c index 25a359a..ef42fbe 100644 --- a/keydb_dynamic.c +++ b/keydb_dynamic.c @@ -13,8 +13,7 @@ * more details. * * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * this program. If not, see . */ #include @@ -292,11 +291,20 @@ struct onak_dbctx *keydb_dynamic_init(struct onak_db_config *dbcfg, soname = NULL; exit(EXIT_FAILURE); } - free(soname); - soname = NULL; privctx->loadeddbctx = backend_init(dbcfg, readonly); + if (privctx->loadeddbctx == NULL) { + logthing(LOGTHING_CRITICAL, + "Failed to initialise dynamic backend: %s", + soname); + free(soname); + soname = NULL; + exit(EXIT_FAILURE); + } + free(soname); + soname = NULL; + if (privctx->loadeddbctx != NULL) { dbctx->cleanupdb = dynamic_cleanupdb; dbctx->starttrans = dynamic_starttrans;