Skip to content

Fix LocalFree leak in error_wsaerror - #749

Open
ManiSalahmand wants to merge 1 commit into
quickfix:masterfrom
ManiSalahmand:fix/555-wsaerror-localfree-leak
Open

Fix LocalFree leak in error_wsaerror#749
ManiSalahmand wants to merge 1 commit into
quickfix:masterfrom
ManiSalahmand:fix/555-wsaerror-localfree-leak

Conversation

@ManiSalahmand

Copy link
Copy Markdown

Summary

  • release the buffer allocated by FormatMessageA using an exception-safe scope guard
  • check both the formatting result and buffer before appending message text
  • preserve existing successful WSA error output
  • return a deterministic wrapper-only string when formatting fails
  • add a focused Windows-only failure-path assertion

Testing

  • Linux Release configure and build passed
  • clang-format and git diff checks passed
  • non-network UtilityTests passed
  • full Linux unit run reached 1,955 passing assertions; eight socket assertions were blocked by sandbox network restrictions
  • Windows-specific behavior remains to be validated by CI

Fixes #555

- release the buffer allocated by `FormatMessageA` using an exception-safe scope guard
- check both the formatting result and buffer before appending message text
- preserve existing successful WSA error output
- return a deterministic wrapper-only string when formatting fails
- add a focused Windows-only failure-path assertion

- Linux Release configure and build passed
- clang-format and git diff checks passed
- non-network UtilityTests passed
- full Linux unit run reached 1,955 passing assertions; eight socket assertions were blocked by sandbox network restrictions
- Windows-specific behavior remains to be validated by CI

Fixes quickfix#555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error_wsaerror should use LocalFree to release the buffer

1 participant