]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - keydb_db4.c
Make failure to load backend fatal.
[onak.git] / keydb_db4.c
index 6d57cd312b938b76d46a5f29875122a0a18d3db1..80397aacaadaa7465c1c4a9b682aaf598a071c78 100644 (file)
@@ -144,6 +144,8 @@ void initdb(bool readonly)
                                        "Error opening db environment: %s (%s)",
                                        config.db_dir,
                                        db_strerror(ret));
                                        "Error opening db environment: %s (%s)",
                                        config.db_dir,
                                        db_strerror(ret));
+                       dbenv->close(dbenv, 0);
+                       dbenv = NULL;
                }
        }
 
                }
        }
 
@@ -270,6 +272,8 @@ void cleanupdb(void)
                                dbconns[i] = NULL;
                        }
                }
                                dbconns[i] = NULL;
                        }
                }
+               free(dbconns);
+               dbconns = NULL;
                dbenv->close(dbenv, 0);
                dbenv = NULL;
        }
                dbenv->close(dbenv, 0);
                dbenv = NULL;
        }