From: Adam Dickmeiss Date: Wed, 26 Feb 2014 10:00:59 +0000 (+0100) Subject: Fix ZOOM_connection_connect SEGVs if host==NULL YAZ-746 X-Git-Tag: v5.0.17~1 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=adbe5f4a8c685c31a978fcfc85c9099ebf647927;ds=sidebyside Fix ZOOM_connection_connect SEGVs if host==NULL YAZ-746 --- diff --git a/src/zoom-c.c b/src/zoom-c.c index b1f5aca..1bbac7e 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -361,7 +361,6 @@ ZOOM_API(void) const char *host, int portnum) { const char *val; - const char *http_lead; initlog(); @@ -428,16 +427,18 @@ ZOOM_API(void) else c->lang = 0; - val = ZOOM_options_get(c->options, "sru"); - if (val && *val && !strstr(host, "://")) - http_lead = "http://"; - else - http_lead = ""; - c->sru_mode = get_sru_mode_from_string(val); - if (host) { char hostn[128]; + const char *http_lead; + + val = ZOOM_options_get(c->options, "sru"); + if (val && *val && !strstr(host, "://")) + http_lead = "http://"; + else + http_lead = ""; + c->sru_mode = get_sru_mode_from_string(val); + xfree(c->host_port); if (portnum) {