]> the.earth.li Git - onak.git/blobdiff - cgi/gpgwww.c
Handle failed database initialisation more gracefully
[onak.git] / cgi / gpgwww.c
index 0fc58fb3762f1b40b539e8bf80cd1352a8f7a149..c814e8f0d0b920648854567aacfc6171a12a38cc 100644 (file)
@@ -180,6 +180,10 @@ int main(int argc, char *argv[])
        initlogthing("gpgwww", config.logfile);
        catchsignals();
        dbctx = config.dbinit(config.backend, true);
+       if (dbctx == NULL) {
+               puts("Failed to open key database.");
+               goto err;
+       }
        inithash();
        logthing(LOGTHING_NOTICE, "Looking for path from 0x%016" PRIX64
                        " to 0x%016"
@@ -193,6 +197,8 @@ int main(int argc, char *argv[])
        }
        destroyhash();
        dbctx->cleanupdb(dbctx);
+
+err:
        cleanuplogthing();
        cleanupconfig();