From: Jay Satiro Date: Sun, 29 Dec 2019 19:18:48 +0000 (-0500) Subject: tool_operate: fix mem leak when failed config parse X-Git-Tag: curl-7_68_0~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=249f7b37e610477a4c16810c77a8605b464a653e;p=thirdparty%2Fcurl.git tool_operate: fix mem leak when failed config parse Found by fuzzing the config file. Reported-by: Geeknik Labs Fixes https://github.com/curl/curl/issues/4767 --- diff --git a/src/tool_operate.c b/src/tool_operate.c index d4f170e333..61b1306723 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -720,8 +720,10 @@ static CURLcode single_transfer(struct GlobalConfig *global, if(SetHTTPrequest(config, HTTPREQ_SIMPLEPOST, &config->httpreq)) result = CURLE_FAILED_INIT; } - if(result) + if(result) { + single_transfer_cleanup(config); return result; + } } if(!state->urlnode) { /* first time caller, setup things */