From 36bb133e61822e47f79fe2eaca056ba6248b1c53 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 15 Apr 2013 12:34:34 +1000 Subject: [PATCH] Cleanup when stratum curl fails to initialise. --- util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util.c b/util.c index 2e02c226..ffe4b941 100644 --- a/util.c +++ b/util.c @@ -1501,6 +1501,8 @@ static bool setup_stratum_curl(struct pool *pool) curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1); if (curl_easy_perform(curl)) { applog(LOG_INFO, "Stratum connect failed to pool %d: %s", pool->pool_no, curl_err_str); + curl_easy_cleanup(curl); + pool->stratum_curl = NULL; return false; } curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, (long *)&pool->sock);