Skip to content

Replace realloc with std::vector in IOThreadProc#10821

Open
qorexdevs wants to merge 1 commit into
Icinga:masterfrom
qorexdevs:bugfix/replace-realloc-with-vector-10813
Open

Replace realloc with std::vector in IOThreadProc#10821
qorexdevs wants to merge 1 commit into
Icinga:masterfrom
qorexdevs:bugfix/replace-realloc-with-vector-10813

Conversation

@qorexdevs
Copy link
Copy Markdown

Replaces the raw realloc calls in Process::IOThreadProc() with std::vector for the handles/fhandles (Windows) and pfds (Linux) arrays. The vectors handle resizing and memory cleanup automatically -- the old raw pointers were never freed since the function loops forever, so this also fixes a minor leak if the thread ever exits.

fixes #10813

The raw realloc calls in Process::IOThreadProc() are replaced with
std::vector, which handles resizing and cleanup automatically.
Also fixes a minor memory leak since the old pointers were never freed.

refs Icinga#10813
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 23, 2026

Thank you for your pull request. Before we can look at it, you'll need to sign a Contributor License Agreement (CLA).

Please follow instructions at https://icinga.com/company/contributor-agreement to sign the CLA.

After that, please reply here with a comment and we'll verify.

Contributors that have not signed yet: @qorexdevs

Details
  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Please contact us if you think this is the case.

  • If you signed the CLA as a corporation, your GitHub username may not have been submitted to us. Please reach out to the responsible person in your organization.

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.

Replace realloc(3) and maybe malloc(3) with std::vector

1 participant