Skip to content

Conversation

@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Nov 12, 2025

This addresses cases reported by @arinochk in #5008.

See individual commits for details.

@kolyshkin kolyshkin marked this pull request as ready for review November 12, 2025 22:47
This function calls Init what normally never returns, so the defer only
works if there is an error and we can safely use it to close those fds
we opened. This was done for most but not all fds.

Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still feels a bit strange to defer closing stuff in startInitialization but it is what it is...

@cyphar cyphar linked an issue Nov 13, 2025 that may be closed by this pull request
@kolyshkin
Copy link
Contributor Author

It still feels a bit strange to defer closing stuff in startInitialization but it is what it is...

There are a few (well, 3, to be exact) comments in there saying normally this function does not return and the defers are never called unless there's an error. Yet it takes some time to realize how things work here.

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.

SAST Potential resource leaks

2 participants