]> the.earth.li Git - onak.git/blobdiff - keydb_dynamic.c
Error out when trying to load a dynamic backend with no configuration
[onak.git] / keydb_dynamic.c
index 040a045f67cf388038cbad5c4a4c574e836a7016..5bc539ce25c0ee539b04d1ec1d0264c7eb80e966 100644 (file)
@@ -215,6 +215,12 @@ struct onak_dbctx *keydb_dynamic_init(struct onak_db_config *dbcfg,
        struct onak_dbctx *(*backend_init)(struct onak_db_config *, bool);
        struct onak_dynamic_dbctx *privctx;
 
+       if (dbcfg == NULL) {
+               logthing(LOGTHING_CRITICAL,
+                       "No backend database configuration supplied.");
+               return NULL;
+       }
+
        dbctx = malloc(sizeof(struct onak_dbctx));
 
        if (dbctx == NULL) {