mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:43:38 +03:00
tool_operate: fix minor memory-leak on early error
When .curlrc is parsed successfully but the tool exits early before parse_args() executes; the allocated path was not freed. Spotted by Codex Security Closes #20954
This commit is contained in:
parent
b881bc0021
commit
90b9f51458
1 changed files with 1 additions and 2 deletions
|
|
@ -2296,7 +2296,6 @@ CURLcode operate(int argc, argv_item_t argv[])
|
||||||
if(found_curlrc) {
|
if(found_curlrc) {
|
||||||
/* After parse_args so notef knows the verbosity */
|
/* After parse_args so notef knows the verbosity */
|
||||||
notef("Read config file from '%s'", curlrc_path);
|
notef("Read config file from '%s'", curlrc_path);
|
||||||
curlx_free(curlrc_path);
|
|
||||||
}
|
}
|
||||||
if(err) {
|
if(err) {
|
||||||
result = CURLE_OK;
|
result = CURLE_OK;
|
||||||
|
|
@ -2394,7 +2393,7 @@ CURLcode operate(int argc, argv_item_t argv[])
|
||||||
errorf("out of memory");
|
errorf("out of memory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
curlx_free(curlrc_path);
|
||||||
varcleanup();
|
varcleanup();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue