git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@463
e88ac4ed-0b26-0410-9574-
a7f39faa03bf
char *p, *field;
int ipv6 = 0;
+ if (!hostport) {
+ hp->port = default_port ? stringcopy(default_port, 0) : NULL;
+ return 1;
+ }
p = hostport;
/* allow literal addresses and port, e.g. [2001:db8::1]:1812 */
if (*p == '[') {
if (!parsehostport(hp, hostport, default_port))
goto errexit;
- if (!strcmp(hp->host, "*")) {
+ if (hp->host && !strcmp(hp->host, "*")) {
free(hp->host);
hp->host = NULL;
}