X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/42bcfe2cae29f375af4cf2cd3ccfa196b77a3946..36eef8ab7ec7c90e97f2371d7ca8c80d52fd3e27:/onak-conf.c diff --git a/onak-conf.c b/onak-conf.c index 126bd56..93a9320 100644 --- a/onak-conf.c +++ b/onak-conf.c @@ -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; + } +}