1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 22:45:03 -05:00

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
This commit is contained in:
Jay Satiro 2019-12-29 14:18:48 -05:00
parent 060fb84a5a
commit 249f7b37e6

View File

@ -720,9 +720,11 @@ static CURLcode single_transfer(struct GlobalConfig *global,
if(SetHTTPrequest(config, HTTPREQ_SIMPLEPOST, &config->httpreq)) if(SetHTTPrequest(config, HTTPREQ_SIMPLEPOST, &config->httpreq))
result = CURLE_FAILED_INIT; result = CURLE_FAILED_INIT;
} }
if(result) if(result) {
single_transfer_cleanup(config);
return result; return result;
} }
}
if(!state->urlnode) { if(!state->urlnode) {
/* first time caller, setup things */ /* first time caller, setup things */
state->urlnode = config->url_list; state->urlnode = config->url_list;