tool_operate: fix minor memory-leak on early error#20954
tool_operate: fix minor memory-leak on early error#20954
Conversation
When .curlrc is parsed successfully but the tool exits early before parse_args() executes; the allocated path was not freed. Spotted by Codex Security
There was a problem hiding this comment.
Pull request overview
Fixes a small memory leak in the curl tool’s operate() flow when .curlrc is successfully resolved but execution exits before parse_args() runs (e.g., early help/usage path).
Changes:
- Stop freeing
curlrc_pathonly in thefound_curlrc/ post-parse_args()block. - Free
curlrc_pathunconditionally during the function’s common cleanup path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Analysis of PR #20954 at 8981ae58: Test ../../tests/http/test_05_errors.py::TestErrors::test_05_01_partial_1[h3] failed, but it has been 1.8% flaky lately, so it's probably NOT a fault of the PR. Note that this test has failed in 2 different CI jobs (the link just goes to one of them). Test 1501 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 12 different CI jobs (the link just goes to one of them). Note that this CI job has had a number of other flaky tests recently (2, to be exact) so it may be that this failure is rather a systemic issue with this job and not with this specific PR. Generated by Testclutch |
When .curlrc is parsed successfully but the tool exits early before parse_args() executes; the allocated path was not freed.
Spotted by Codex Security