diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-02-17 22:35:48 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-02-17 22:35:48 -0800 |
| commit | 29c6d4e0a2f7d0627fbfaa6589b5c4e40689ca57 (patch) | |
| tree | 793516b1e03d52e2cd4c4c6ed40eee4bd7a28c3b /src/supplemental/http | |
| parent | 32e6f3978e18224bf5d6d7a3847ea25140ec6122 (diff) | |
| download | nng-29c6d4e0a2f7d0627fbfaa6589b5c4e40689ca57.tar.gz nng-29c6d4e0a2f7d0627fbfaa6589b5c4e40689ca57.tar.bz2 nng-29c6d4e0a2f7d0627fbfaa6589b5c4e40689ca57.zip | |
fixes #821 http_server crash when using url without hostname
Diffstat (limited to 'src/supplemental/http')
| -rw-r--r-- | src/supplemental/http/http_server.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c index 939273b7..cb003aff 100644 --- a/src/supplemental/http/http_server.c +++ b/src/supplemental/http/http_server.c @@ -866,13 +866,11 @@ http_server_init(nni_http_server **serverp, const nni_url *url) return (rv); } - if ((strlen(url->u_port)) && - ((s->port = nni_strdup(url->u_port)) == NULL)) { + if ((s->port = nni_strdup(url->u_port)) == NULL) { http_server_fini(s); return (NNG_ENOMEM); } - if ((strlen(url->u_hostname)) && - ((s->hostname = nni_strdup(url->u_hostname)) == NULL)) { + if ((s->hostname = nni_strdup(url->u_hostname)) == NULL) { http_server_fini(s); return (NNG_ENOMEM); } |
