From: Jaroslav Kysela Date: Thu, 1 Feb 2018 15:46:32 +0000 (+0100) Subject: httpc: fix the memory leak X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dec0db83b574e48d316aaa5e27d65d463e5ca06c;p=thirdparty%2Ftvheadend.git httpc: fix the memory leak --- diff --git a/src/httpc.c b/src/httpc.c index 239a3e264..65feef2c5 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -1480,17 +1480,17 @@ http_client_reconnect goto errnval; port = http_port(hc, scheme, port); - hc->hc_pevents = 0; - hc->hc_version = ver; - hc->hc_redirv = ver; - hc->hc_scheme = strdup(scheme); - hc->hc_host = strdup(host); - hc->hc_port = port; hc->hc_fd = tcp_connect(host, port, hc->hc_bindaddr, errbuf, sizeof(errbuf), -1); if (hc->hc_fd < 0) { tvherror(LS_HTTPC, "%04X: Unable to connect to %s:%i - %s", shortid(hc), host, port, errbuf); goto errnval; } + hc->hc_pevents = 0; + hc->hc_version = ver; + hc->hc_redirv = ver; + hc->hc_port = port; + hc->hc_scheme = strdup(scheme); + hc->hc_host = strdup(host); hc->hc_einprogress = 1; tvhtrace(LS_HTTPC, "%04X: Connected to %s:%i", shortid(hc), host, port); http_client_ssl_free(hc);