Skip to content

Commit

Permalink
Handle host:port command line parsing failure
Browse files Browse the repository at this point in the history
Fixes: #72
  • Loading branch information
daghf committed Apr 19, 2016
1 parent 7c5e4b1 commit be99286
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,16 +635,19 @@ config_param_validate(char *k, char *v, hitch_config *cfg,
fa = front_arg_new();
r = config_param_host_port_wildcard(v,
&fa->ip, &fa->port, &certfile, 1);
if (certfile != NULL) {
r = config_param_pem_file(certfile, &cert);
if (r != 0) {
AN(cert);
HASH_ADD_KEYPTR(hh, fa->certs, cert->filename,
strlen(cert->filename), cert);
}
free(certfile);
if (r != 0) {
if (certfile != NULL) {
r = config_param_pem_file(certfile, &cert);
if (r != 0) {
AN(cert);
HASH_ADD_KEYPTR(hh,
fa->certs, cert->filename,
strlen(cert->filename), cert);
}
free(certfile);
}
r = front_arg_add(cfg, fa);
}
r = front_arg_add(cfg, fa);
} else if (strcmp(k, CFG_BACKEND) == 0) {
free(cfg->BACK_PORT);
free(cfg->BACK_IP);
Expand Down

0 comments on commit be99286

Please sign in to comment.