1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04: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,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 */