case BINDADDR:
setting = config_lookup(&configuration, "bindaddr");
if (!setting)
- return "";
+ return NULL;
else {
if ((strsetting = config_setting_get_string(setting)) != NULL)
return strsetting;
else
- return "";
+ return NULL;
}
break;
case BINDADDR6:
setting = config_lookup(&configuration, "bindaddr6");
if (!setting)
- return "";
+ return NULL;
else {
if ((strsetting = config_setting_get_string(setting)) != NULL)
return strsetting;
else
- return "";
+ return NULL;
}
break;
case WELCOMETEXT:
struct sockaddr_storage** Server_setupAddressesAndPorts()
{
- struct sockaddr_storage** addresses;
+ struct sockaddr_storage** addresses = malloc(2 * sizeof(void*));
struct sockaddr_storage* v4address = calloc(1, sizeof(struct sockaddr_storage));
v4address->ss_family = AF_INET;
: bindaddr, &(((struct sockaddr_in*)v4address)->sin_addr));
if (error == 0) Log_fatal("Invalid IPv4 address supplied!");
- error = inet_pton(AF_INET, (!bindaddr6) ? ((getStrConf(BINDADDR6)) ? getStrConf(BINDADDR6) : "::")
+ error = inet_pton(AF_INET6, (!bindaddr6) ? ((getStrConf(BINDADDR6)) ? getStrConf(BINDADDR6) : "::")
: bindaddr6, &(((struct sockaddr_in6*)v6address)->sin6_addr));
if (error == 0) Log_fatal("Invalid IPv6 address supplied!");