The dynamic DB backend does a lot of checks to ensure it can load the
requested backend successfully, but didn't actually check that it
initialised correctly. Bomb out with a graceful error message if this
happens rather than leading the caller to think everything is ok.
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;