]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - onak-conf.c
cscvs to tla changeset 56
[onak.git] / onak-conf.c
index 126bd565d4409515bf2f084333e8f27244791283..93a9320b4a3e165db6dbdd3e8ca1691b255d01db 100644 (file)
@@ -30,13 +30,13 @@ struct onak_config config = {
        /*
         * Options for directory backends.
         */
-       "/home/noodles/onak-db",        /* db_dir */
+       NULL,                   /* db_dir */
 
        /*
         * Options for the Postgres backend.
         */
        NULL,                   /* pg_dbhost */
-       "noodles",              /* pg_dbname */
+       NULL,                   /* pg_dbname */
        NULL,                   /* pg_dbuser */
        NULL,                   /* pg_dbpass */
 };
@@ -124,3 +124,42 @@ void readconfig(void) {
                fprintf(stderr, "Couldn't open config file; using defaults.\n");
        }
 }
+
+void cleanupconfig(void) {
+       if (config.thissite != NULL) {
+               free(config.thissite);
+               config.thissite = NULL;
+       }
+       if (config.adminemail != NULL) {
+               free(config.adminemail);
+               config.adminemail = NULL;
+       }
+       if (config.mta != NULL) {
+               free(config.mta);
+               config.mta = NULL;
+       }
+       if (config.db_dir != NULL) {
+               free(config.db_dir);
+               config.db_dir = NULL;
+       }
+       if (config.pg_dbhost != NULL) {
+               free(config.pg_dbhost);
+               config.pg_dbhost = NULL;
+       }
+       if (config.pg_dbname != NULL) {
+               free(config.pg_dbname);
+               config.pg_dbname = NULL;
+       }
+       if (config.pg_dbuser != NULL) {
+               free(config.pg_dbuser);
+               config.pg_dbuser = NULL;
+       }
+       if (config.pg_dbpass != NULL) {
+               free(config.pg_dbpass);
+               config.pg_dbpass = NULL;
+       }
+       if (config.syncsites != NULL) {
+               llfree(config.syncsites, free);
+               config.syncsites = NULL;
+       }
+}