diff --git a/src/Config.c b/src/Config.c index 210c5dc..63e7aca 100644 --- a/src/Config.c +++ b/src/Config.c @@ -136,6 +136,8 @@ ConfigCreateDefault(Db * db) config.registration = 0; config.federation = 1; + config.serverName = Malloc(HOST_NAME_MAX + 1); + memset(config.serverName, 0, HOST_NAME_MAX + 1); gethostname(config.serverName, HOST_NAME_MAX); len = strlen(config.serverName) + 10; config.baseUrl = Malloc(len); @@ -151,13 +153,6 @@ ConfigCreateDefault(Db * db) listener->tls.cert = NULL; ArrayAdd(config.listen, listener); - config.serverName = Malloc(HOST_NAME_MAX + 1); - - /* TODO: Don't set that field(it has to because otherwise j2s will add - * a NULL byte it seems.) */ - config.identityServer = StrDuplicate(""); - - json = ConfigToJson(&config); ref = DbCreate(db, 1, "config");