Commit d3815dfd authored by linus's avatar linus Committed by linus

Reindent and remove trailing whitespace.

git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@517 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent 317902ce
...@@ -68,7 +68,7 @@ int debug_set_destination(char *dest) { ...@@ -68,7 +68,7 @@ int debug_set_destination(char *dest) {
LOG_LOCAL5, LOG_LOCAL6, LOG_LOCAL7 }; LOG_LOCAL5, LOG_LOCAL6, LOG_LOCAL7 };
extern int errno; extern int errno;
int i; int i;
if (!strncasecmp(dest, "file:///", 8)) { if (!strncasecmp(dest, "file:///", 8)) {
debug_filepath = stringcopy(dest + 7, 0); debug_filepath = stringcopy(dest + 7, 0);
debug_file = fopen(debug_filepath, "a"); debug_file = fopen(debug_filepath, "a");
...@@ -127,7 +127,7 @@ void debug_logit(uint8_t level, const char *format, va_list ap) { ...@@ -127,7 +127,7 @@ void debug_logit(uint8_t level, const char *format, va_list ap) {
struct timeval now; struct timeval now;
char *timebuf; char *timebuf;
int priority; int priority;
if (debug_syslogfacility) { if (debug_syslogfacility) {
switch (level) { switch (level) {
case DBG_DBG: case DBG_DBG:
......
...@@ -95,7 +95,7 @@ struct sessioncacheentry { ...@@ -95,7 +95,7 @@ struct sessioncacheentry {
struct dtlsservernewparams { struct dtlsservernewparams {
struct sessioncacheentry *sesscache; struct sessioncacheentry *sesscache;
int sock; int sock;
struct sockaddr_storage addr; struct sockaddr_storage addr;
}; };
void dtlssetsrcres() { void dtlssetsrcres() {
...@@ -109,7 +109,7 @@ int udp2bio(int s, struct gqueue *q, int cnt) { ...@@ -109,7 +109,7 @@ int udp2bio(int s, struct gqueue *q, int cnt) {
if (cnt < 1) if (cnt < 1)
return 0; return 0;
buf = malloc(cnt); buf = malloc(cnt);
if (!buf) { if (!buf) {
unsigned char err; unsigned char err;
...@@ -162,7 +162,7 @@ BIO *getrbio(SSL *ssl, struct gqueue *q, int timeout) { ...@@ -162,7 +162,7 @@ BIO *getrbio(SSL *ssl, struct gqueue *q, int timeout) {
int dtlsread(SSL *ssl, struct gqueue *q, unsigned char *buf, int num, int timeout) { int dtlsread(SSL *ssl, struct gqueue *q, unsigned char *buf, int num, int timeout) {
int len, cnt; int len, cnt;
BIO *rbio; BIO *rbio;
for (len = 0; len < num; len += cnt) { for (len = 0; len < num; len += cnt) {
cnt = SSL_read(ssl, buf + len, num - len); cnt = SSL_read(ssl, buf + len, num - len);
if (cnt <= 0) if (cnt <= 0)
...@@ -171,7 +171,7 @@ int dtlsread(SSL *ssl, struct gqueue *q, unsigned char *buf, int num, int timeou ...@@ -171,7 +171,7 @@ int dtlsread(SSL *ssl, struct gqueue *q, unsigned char *buf, int num, int timeou
rbio = getrbio(ssl, q, timeout); rbio = getrbio(ssl, q, timeout);
if (!rbio) if (!rbio)
return 0; return 0;
BIO_free(ssl->rbio); BIO_free(ssl->rbio);
ssl->rbio = rbio; ssl->rbio = rbio;
cnt = 0; cnt = 0;
continue; continue;
...@@ -199,7 +199,7 @@ SSL *dtlsacccon(uint8_t acc, SSL_CTX *ctx, int s, struct sockaddr *addr, struct ...@@ -199,7 +199,7 @@ SSL *dtlsacccon(uint8_t acc, SSL_CTX *ctx, int s, struct sockaddr *addr, struct
ssl = SSL_new(ctx); ssl = SSL_new(ctx);
if (!ssl) if (!ssl)
return NULL; return NULL;
mem0bio = BIO_new(BIO_s_mem()); mem0bio = BIO_new(BIO_s_mem());
BIO_set_mem_eof_return(mem0bio, -1); BIO_set_mem_eof_return(mem0bio, -1);
wbio = BIO_new_dgram(s, BIO_NOCLOSE); wbio = BIO_new_dgram(s, BIO_NOCLOSE);
...@@ -244,21 +244,21 @@ unsigned char *raddtlsget(SSL *ssl, struct gqueue *rbios, int timeout) { ...@@ -244,21 +244,21 @@ unsigned char *raddtlsget(SSL *ssl, struct gqueue *rbios, int timeout) {
continue; continue;
} }
memcpy(rad, buf, 4); memcpy(rad, buf, 4);
cnt = dtlsread(ssl, rbios, rad + 4, len - 4, timeout); cnt = dtlsread(ssl, rbios, rad + 4, len - 4, timeout);
if (cnt < 1) { if (cnt < 1) {
debug(DBG_DBG, cnt ? "raddtlsget: connection lost" : "raddtlsget: timeout"); debug(DBG_DBG, cnt ? "raddtlsget: connection lost" : "raddtlsget: timeout");
free(rad); free(rad);
return NULL; return NULL;
} }
if (len >= 20) if (len >= 20)
break; break;
free(rad); free(rad);
debug(DBG_WARN, "raddtlsget: packet smaller than minimum radius size"); debug(DBG_WARN, "raddtlsget: packet smaller than minimum radius size");
} }
debug(DBG_DBG, "raddtlsget: got %d bytes", len); debug(DBG_DBG, "raddtlsget: got %d bytes", len);
return rad; return rad;
} }
...@@ -269,13 +269,13 @@ void *dtlsserverwr(void *arg) { ...@@ -269,13 +269,13 @@ void *dtlsserverwr(void *arg) {
struct client *client = (struct client *)arg; struct client *client = (struct client *)arg;
struct gqueue *replyq; struct gqueue *replyq;
struct request *reply; struct request *reply;
debug(DBG_DBG, "dtlsserverwr: starting for %s", addr2string(client->addr)); debug(DBG_DBG, "dtlsserverwr: starting for %s", addr2string(client->addr));
replyq = client->replyq; replyq = client->replyq;
for (;;) { for (;;) {
pthread_mutex_lock(&replyq->mutex); pthread_mutex_lock(&replyq->mutex);
while (!list_first(replyq->entries)) { while (!list_first(replyq->entries)) {
if (client->ssl) { if (client->ssl) {
debug(DBG_DBG, "dtlsserverwr: waiting for signal"); debug(DBG_DBG, "dtlsserverwr: waiting for signal");
pthread_cond_wait(&replyq->cond, &replyq->mutex); pthread_cond_wait(&replyq->cond, &replyq->mutex);
debug(DBG_DBG, "dtlsserverwr: got signal"); debug(DBG_DBG, "dtlsserverwr: got signal");
...@@ -305,7 +305,7 @@ void dtlsserverrd(struct client *client) { ...@@ -305,7 +305,7 @@ void dtlsserverrd(struct client *client) {
struct request *rq; struct request *rq;
uint8_t *buf; uint8_t *buf;
pthread_t dtlsserverwrth; pthread_t dtlsserverwrth;
debug(DBG_DBG, "dtlsserverrd: starting for %s", addr2string(client->addr)); debug(DBG_DBG, "dtlsserverrd: starting for %s", addr2string(client->addr));
if (pthread_create(&dtlsserverwrth, NULL, dtlsserverwr, (void *)client)) { if (pthread_create(&dtlsserverwrth, NULL, dtlsserverwr, (void *)client)) {
...@@ -332,7 +332,7 @@ void dtlsserverrd(struct client *client) { ...@@ -332,7 +332,7 @@ void dtlsserverrd(struct client *client) {
break; break;
} }
} }
/* stop writer by setting ssl to NULL and give signal in case waiting for data */ /* stop writer by setting ssl to NULL and give signal in case waiting for data */
client->ssl = NULL; client->ssl = NULL;
...@@ -392,7 +392,7 @@ void *dtlsservernew(void *arg) { ...@@ -392,7 +392,7 @@ void *dtlsservernew(void *arg) {
if (cert) if (cert)
X509_free(cert); X509_free(cert);
exit: exit:
if (ssl) { if (ssl) {
SSL_shutdown(ssl); SSL_shutdown(ssl);
SSL_free(ssl); SSL_free(ssl);
...@@ -413,7 +413,7 @@ void cacheexpire(struct hash *cache, struct timeval *last) { ...@@ -413,7 +413,7 @@ void cacheexpire(struct hash *cache, struct timeval *last) {
struct timeval now; struct timeval now;
struct hash_entry *he; struct hash_entry *he;
struct sessioncacheentry *e; struct sessioncacheentry *e;
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
if (now.tv_sec - last->tv_sec < 19) if (now.tv_sec - last->tv_sec < 19)
return; return;
...@@ -448,12 +448,12 @@ void *udpdtlsserverrd(void *arg) { ...@@ -448,12 +448,12 @@ void *udpdtlsserverrd(void *arg) {
pthread_t dtlsserverth; pthread_t dtlsserverth;
struct hash *sessioncache; struct hash *sessioncache;
struct sessioncacheentry *cacheentry; struct sessioncacheentry *cacheentry;
sessioncache = hash_create(); sessioncache = hash_create();
if (!sessioncache) if (!sessioncache)
debugx(1, DBG_ERR, "udpdtlsserverrd: malloc failed"); debugx(1, DBG_ERR, "udpdtlsserverrd: malloc failed");
gettimeofday(&lastexpiry, NULL); gettimeofday(&lastexpiry, NULL);
for (;;) { for (;;) {
FD_ZERO(&readfds); FD_ZERO(&readfds);
FD_SET(s, &readfds); FD_SET(s, &readfds);
...@@ -532,7 +532,7 @@ int dtlsconnect(struct server *server, struct timeval *when, int timeout, char * ...@@ -532,7 +532,7 @@ int dtlsconnect(struct server *server, struct timeval *when, int timeout, char *
X509 *cert; X509 *cert;
SSL_CTX *ctx = NULL; SSL_CTX *ctx = NULL;
struct hostportres *hp; struct hostportres *hp;
debug(DBG_DBG, "dtlsconnect: called from %s", text); debug(DBG_DBG, "dtlsconnect: called from %s", text);
pthread_mutex_lock(&server->lock); pthread_mutex_lock(&server->lock);
if (when && memcmp(&server->lastconnecttry, when, sizeof(struct timeval))) { if (when && memcmp(&server->lastconnecttry, when, sizeof(struct timeval))) {
...@@ -579,11 +579,11 @@ int dtlsconnect(struct server *server, struct timeval *when, int timeout, char * ...@@ -579,11 +579,11 @@ int dtlsconnect(struct server *server, struct timeval *when, int timeout, char *
if (!server->ssl) if (!server->ssl)
continue; continue;
debug(DBG_DBG, "dtlsconnect: DTLS: ok"); debug(DBG_DBG, "dtlsconnect: DTLS: ok");
cert = verifytlscert(server->ssl); cert = verifytlscert(server->ssl);
if (!cert) if (!cert)
continue; continue;
if (verifyconfcert(cert, server->conf)) if (verifyconfcert(cert, server->conf))
break; break;
X509_free(cert); X509_free(cert);
...@@ -622,7 +622,7 @@ void *udpdtlsclientrd(void *arg) { ...@@ -622,7 +622,7 @@ void *udpdtlsclientrd(void *arg) {
socklen_t fromlen = sizeof(from); socklen_t fromlen = sizeof(from);
struct clsrvconf *conf; struct clsrvconf *conf;
fd_set readfds; fd_set readfds;
for (;;) { for (;;) {
FD_ZERO(&readfds); FD_ZERO(&readfds);
FD_SET(s, &readfds); FD_SET(s, &readfds);
...@@ -633,7 +633,7 @@ void *udpdtlsclientrd(void *arg) { ...@@ -633,7 +633,7 @@ void *udpdtlsclientrd(void *arg) {
debug(DBG_WARN, "udpdtlsclientrd: recv failed"); debug(DBG_WARN, "udpdtlsclientrd: recv failed");
continue; continue;
} }
conf = find_srvconf(handle, (struct sockaddr *)&from, NULL); conf = find_srvconf(handle, (struct sockaddr *)&from, NULL);
if (!conf) { if (!conf) {
debug(DBG_WARN, "udpdtlsclientrd: got packet from wrong or unknown DTLS peer %s, ignoring", addr2string((struct sockaddr *)&from)); debug(DBG_WARN, "udpdtlsclientrd: got packet from wrong or unknown DTLS peer %s, ignoring", addr2string((struct sockaddr *)&from));
...@@ -650,7 +650,7 @@ void *dtlsclientrd(void *arg) { ...@@ -650,7 +650,7 @@ void *dtlsclientrd(void *arg) {
unsigned char *buf; unsigned char *buf;
struct timeval lastconnecttry; struct timeval lastconnecttry;
int secs; int secs;
for (;;) { for (;;) {
/* yes, lastconnecttry is really necessary */ /* yes, lastconnecttry is really necessary */
lastconnecttry = server->lastconnecttry; lastconnecttry = server->lastconnecttry;
...@@ -696,7 +696,7 @@ void initextradtls() { ...@@ -696,7 +696,7 @@ void initextradtls() {
freeaddrinfo(srcres); freeaddrinfo(srcres);
srcres = NULL; srcres = NULL;
} }
if (client4_sock >= 0) if (client4_sock >= 0)
if (pthread_create(&cl4th, NULL, udpdtlsclientrd, (void *)&client4_sock)) if (pthread_create(&cl4th, NULL, udpdtlsclientrd, (void *)&client4_sock))
debugx(1, DBG_ERR, "pthread_create failed"); debugx(1, DBG_ERR, "pthread_create failed");
......
...@@ -87,7 +87,7 @@ FILE *pushgconffile(struct gconffile **cf, FILE *file, const char *description) ...@@ -87,7 +87,7 @@ FILE *pushgconffile(struct gconffile **cf, FILE *file, const char *description)
desc = stringcopy(description, 0); desc = stringcopy(description, 0);
if (!desc) if (!desc)
goto errmalloc; goto errmalloc;
if (!*cf) { if (!*cf) {
newcf = malloc(sizeof(struct gconffile) * 2); newcf = malloc(sizeof(struct gconffile) * 2);
if (!newcf) if (!newcf)
...@@ -105,8 +105,8 @@ FILE *pushgconffile(struct gconffile **cf, FILE *file, const char *description) ...@@ -105,8 +105,8 @@ FILE *pushgconffile(struct gconffile **cf, FILE *file, const char *description)
newcf[0].path = desc; newcf[0].path = desc;
*cf = newcf; *cf = newcf;
return file; return file;
errmalloc: errmalloc:
free(desc); free(desc);
fclose(file); fclose(file);
debug(DBG_ERR, "malloc failed"); debug(DBG_ERR, "malloc failed");
...@@ -125,7 +125,7 @@ FILE *pushgconfpaths(struct gconffile **cf, const char *cfgpath) { ...@@ -125,7 +125,7 @@ FILE *pushgconfpaths(struct gconffile **cf, const char *cfgpath) {
FILE *f = NULL; FILE *f = NULL;
glob_t globbuf; glob_t globbuf;
char *path, *curfile = NULL, *dir; char *path, *curfile = NULL, *dir;
/* if cfgpath is relative, make it relative to current config */ /* if cfgpath is relative, make it relative to current config */
if (*cfgpath == '/') if (*cfgpath == '/')
path = (char *)cfgpath; path = (char *)cfgpath;
...@@ -156,10 +156,10 @@ FILE *pushgconfpaths(struct gconffile **cf, const char *cfgpath) { ...@@ -156,10 +156,10 @@ FILE *pushgconfpaths(struct gconffile **cf, const char *cfgpath) {
f = pushgconfpath(cf, globbuf.gl_pathv[i]); f = pushgconfpath(cf, globbuf.gl_pathv[i]);
if (!f) if (!f)
break; break;
} }
globfree(&globbuf); globfree(&globbuf);
exit: exit:
if (curfile) { if (curfile) {
free(curfile); free(curfile);
free(path); free(path);
...@@ -204,7 +204,7 @@ void freegconf(struct gconffile **cf) { ...@@ -204,7 +204,7 @@ void freegconf(struct gconffile **cf) {
if (!*cf) if (!*cf)
return; return;
for (i = 0; (*cf)[i].data || (*cf)[i].path; i++) { for (i = 0; (*cf)[i].data || (*cf)[i].path; i++) {
if ((*cf)[i].file) { if ((*cf)[i].file) {
fclose((*cf)[i].file); fclose((*cf)[i].file);
...@@ -242,10 +242,10 @@ struct gconffile *openconfigfile(const char *file) { ...@@ -242,10 +242,10 @@ struct gconffile *openconfigfile(const char *file) {
int getlinefromcf(struct gconffile *cf, char *line, const size_t size) { int getlinefromcf(struct gconffile *cf, char *line, const size_t size) {
size_t i, pos; size_t i, pos;
if (!cf) if (!cf)
return 0; return 0;
if (cf->file) if (cf->file)
return fgets(line, size, cf->file) ? 1 : 0; return fgets(line, size, cf->file) ? 1 : 0;
else if (cf->data) { else if (cf->data) {
...@@ -269,11 +269,11 @@ int getconfigline(struct gconffile **cf, char *block, char **opt, char **val, in ...@@ -269,11 +269,11 @@ int getconfigline(struct gconffile **cf, char *block, char **opt, char **val, in
char line[1024]; char line[1024];
char *tokens[3], *s; char *tokens[3], *s;
int tcount; int tcount;
*opt = NULL; *opt = NULL;
*val = NULL; *val = NULL;
*conftype = 0; *conftype = 0;
if (!cf || !*cf || (!(*cf)->file && !(*cf)->data)) if (!cf || !*cf || (!(*cf)->file && !(*cf)->data))
return 1; return 1;
...@@ -304,7 +304,7 @@ int getconfigline(struct gconffile **cf, char *block, char **opt, char **val, in ...@@ -304,7 +304,7 @@ int getconfigline(struct gconffile **cf, char *block, char **opt, char **val, in
} }
break; break;
} }
switch (tcount) { switch (tcount) {
case 2: case 2:
*opt = stringcopy(tokens[0], 0); *opt = stringcopy(tokens[0], 0);
...@@ -347,13 +347,13 @@ int getconfigline(struct gconffile **cf, char *block, char **opt, char **val, in ...@@ -347,13 +347,13 @@ int getconfigline(struct gconffile **cf, char *block, char **opt, char **val, in
if (**val) if (**val)
return 1; return 1;
debug(DBG_ERR, "configuration error, option %s needs a non-empty value", *opt); debug(DBG_ERR, "configuration error, option %s needs a non-empty value", *opt);
goto errexit; goto errexit;
errmalloc: errmalloc:
debug(DBG_ERR, "malloc failed"); debug(DBG_ERR, "malloc failed");
errexit: errexit:
free(*opt); free(*opt);
*opt = NULL; *opt = NULL;
free(*val); free(*val);
...@@ -411,7 +411,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) { ...@@ -411,7 +411,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
free(val); free(val);
continue; continue;
} }
va_start(ap, block); va_start(ap, block);
while ((word = va_arg(ap, char *))) { while ((word = va_arg(ap, char *))) {
type = va_arg(ap, int); type = va_arg(ap, int);
...@@ -449,7 +449,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) { ...@@ -449,7 +449,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
break; break;
} }
va_end(ap); va_end(ap);
if (!word) { if (!word) {
if (block) if (block)
debug(DBG_ERR, "configuration error in block %s, unknown option %s", block, opt); debug(DBG_ERR, "configuration error in block %s, unknown option %s", block, opt);
...@@ -532,15 +532,15 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) { ...@@ -532,15 +532,15 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
} }
if (block) if (block)
debug(DBG_DBG, "getgenericconfig: block %s: %s = %s", block, opt, val); debug(DBG_DBG, "getgenericconfig: block %s: %s = %s", block, opt, val);
else else
debug(DBG_DBG, "getgenericconfig: %s = %s", opt, val); debug(DBG_DBG, "getgenericconfig: %s = %s", opt, val);
if (type == CONF_BLN || type == CONF_LINT) if (type == CONF_BLN || type == CONF_LINT)
free(val); free(val);
} }
errparam: errparam:
debug(DBG_ERR, "getgenericconfig: internal parameter error"); debug(DBG_ERR, "getgenericconfig: internal parameter error");
errexit: errexit:
free(opt); free(opt);
free(val); free(val);
return 0; return 0;
......
...@@ -29,7 +29,7 @@ struct hash *hash_create() { ...@@ -29,7 +29,7 @@ struct hash *hash_create() {
/* frees all memory associated with the hash */ /* frees all memory associated with the hash */
void hash_destroy(struct hash *h) { void hash_destroy(struct hash *h) {
struct list_node *ln; struct list_node *ln;
if (!h) if (!h)
return; return;
for (ln = list_first(h->hashlist); ln; ln = list_next(ln)) { for (ln = list_first(h->hashlist); ln; ln = list_next(ln)) {
...@@ -73,15 +73,15 @@ int hash_insert(struct hash *h, void *key, uint32_t keylen, void *data) { ...@@ -73,15 +73,15 @@ int hash_insert(struct hash *h, void *key, uint32_t keylen, void *data) {
void *hash_read(struct hash *h, void *key, uint32_t keylen) { void *hash_read(struct hash *h, void *key, uint32_t keylen) {
struct list_node *ln; struct list_node *ln;
struct hash_entry *e; struct hash_entry *e;
if (!h) if (!h)
return 0; return 0;
pthread_mutex_lock(&h->mutex); pthread_mutex_lock(&h->mutex);
for (ln = list_first(h->hashlist); ln; ln = list_next(ln)) { for (ln = list_first(h->hashlist); ln; ln = list_next(ln)) {
e = (struct hash_entry *)ln->data; e = (struct hash_entry *)ln->data;
if (e->keylen == keylen && !memcmp(e->key, key, keylen)) { if (e->keylen == keylen && !memcmp(e->key, key, keylen)) {
pthread_mutex_unlock(&h->mutex); pthread_mutex_unlock(&h->mutex);
return e->data; return e->data;
} }
} }
pthread_mutex_unlock(&h->mutex); pthread_mutex_unlock(&h->mutex);
...@@ -92,7 +92,7 @@ void *hash_read(struct hash *h, void *key, uint32_t keylen) { ...@@ -92,7 +92,7 @@ void *hash_read(struct hash *h, void *key, uint32_t keylen) {
void *hash_extract(struct hash *h, void *key, uint32_t keylen) { void *hash_extract(struct hash *h, void *key, uint32_t keylen) {
struct list_node *ln; struct list_node *ln;
struct hash_entry *e; struct hash_entry *e;
if (!h) if (!h)
return 0; return 0;
pthread_mutex_lock(&h->mutex); pthread_mutex_lock(&h->mutex);
......
...@@ -68,24 +68,24 @@ static int parsehostport(struct hostportres *hp, char *hostport, char *default_p ...@@ -68,24 +68,24 @@ static int parsehostport(struct hostportres *hp, char *hostport, char *default_p
} }
} }
if (*p == ':') { if (*p == ':') {
/* port number or service name is specified */; /* port number or service name is specified */;
field = ++p; field = ++p;
for (; *p && *p != ' ' && *p != '\t' && *p != '\n'; p++); for (; *p && *p != ' ' && *p != '\t' && *p != '\n'; p++);
if (field == p) { if (field == p) {
debug(DBG_ERR, "syntax error, : but no following port"); debug(DBG_ERR, "syntax error, : but no following port");
return 0; return 0;
} }
hp->port = stringcopy(field, p - field); hp->port = stringcopy(field, p - field);
} else } else
hp->port = default_port ? stringcopy(default_port, 0) : NULL; hp->port = default_port ? stringcopy(default_port, 0) : NULL;
return 1; return 1;
} }
struct hostportres *newhostport(char *hostport, char *default_port, uint8_t prefixok) { struct hostportres *newhostport(char *hostport, char *default_port, uint8_t prefixok) {
struct hostportres *hp; struct hostportres *hp;
char *slash, *s; char *slash, *s;
int plen; int plen;
hp = malloc(sizeof(struct hostportres)); hp = malloc(sizeof(struct hostportres));
if (!hp) { if (!hp) {
debug(DBG_ERR, "resolve_newhostport: malloc failed"); debug(DBG_ERR, "resolve_newhostport: malloc failed");
...@@ -127,7 +127,7 @@ struct hostportres *newhostport(char *hostport, char *default_port, uint8_t pref ...@@ -127,7 +127,7 @@ struct hostportres *newhostport(char *hostport, char *default_port, uint8_t pref
hp->prefixlen = 255; hp->prefixlen = 255;
return hp; return hp;