From 874edab8375a6a7356506aada10e108617846a2b Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 14 Dec 2016 19:27:57 +1000 Subject: [PATCH] Fix crash on startup --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index bd69995..f6453e4 100644 --- a/main.c +++ b/main.c @@ -116,7 +116,7 @@ static int protocol_config_handler(void* user, const char* section, const char* conf->protocols = (struct protocol **)realloc(conf->protocols, sizeof(struct protocol *) * (conf->protocol_count + 1)); } - conf->protocols[conf->protocol_count] = (struct protocol *)malloc(sizeof(struct archiver)); + conf->protocols[conf->protocol_count] = (struct protocol *)malloc(sizeof(struct protocol)); conf->protocols[conf->protocol_count]->name = strdup(section); conf->protocols[conf->protocol_count]->internal_zmodem = 0; @@ -1102,6 +1102,7 @@ int main(int argc, char **argv) { conf.ipguard_tries = 4; conf.ipguard_timeout = 120; conf.protocol_count = 0; + // Load BBS data if (ini_parse(argv[1], handler, &conf) <0) { fprintf(stderr, "Unable to load configuration ini (%s)!\n", argv[1]);