From bd248a0b8020dde767dca1a46a727c89ae14ee5e Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 28 Feb 2014 21:57:04 +0100 Subject: tool_main: Fixed a memory leak on main_init error --- src/tool_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/tool_main.c') diff --git a/src/tool_main.c b/src/tool_main.c index 955e4795f..1e9156aca 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -154,13 +154,18 @@ static CURLcode main_init(struct GlobalConfig *config) else { helpf(stderr, "error initializing curl easy handle\n"); result = CURLE_FAILED_INIT; + free(config->first); } } - else + else { helpf(stderr, "error retrieving curl library information\n"); + free(config->first); + } } - else + else { helpf(stderr, "error initializing curl library\n"); + free(config->first); + } } else { helpf(stderr, "error initializing curl\n"); -- cgit v1.2.3