From dec0db83b574e48d316aaa5e27d65d463e5ca06c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 1 Feb 2018 16:46:32 +0100 Subject: [PATCH] httpc: fix the memory leak --- src/httpc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); -- 2.47.3