Fix multiple memory leaks in daemon shutdown and JSON handling#72
Open
Fix multiple memory leaks in daemon shutdown and JSON handling#72
Conversation
Member
Author
|
All look legit. |
daccb93 to
9a6f976
Compare
9a6f976 to
b1a16cb
Compare
- add centralized cleanup branches for error/early-return paths in _resolve_rpk_path_in_json() - ensure app_info_node is reset per loop iteration and freed exactly once - release root JSON node on out_err path to prevent leaked JsonNode allocations Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: MyungJoo Ham <myungjoo.ham@samsung.com>
- persist the owner id returned by g_bus_own_name_on_connection() - unown previously owned name before reacquiring to avoid dangling owner handles - release owned DBus name during gdbus_put_system_connection() shutdown path Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: MyungJoo Ham <myungjoo.ham@samsung.com>
- free the GList container allocated via add_module() during exit_modules() - reset module_head to NULL after g_list_free() to avoid stale pointer reuse - keep module->exit callbacks unchanged while eliminating module list node leak Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: MyungJoo Ham <myungjoo.ham@samsung.com>
b1a16cb to
1ddb727
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_resolve_rpk_path_in_json()by adding cleanup on early-return/error paths so allocatedJsonNodeobjects are releasedg_bus_own_name_on_connection()exit_modules()to releaseGListallocations during daemon shutdownSigned-off-byCommits
0433857Fix JSON node leak on early return paths63abac7Release DBus name owner to avoid handle leak9a6f976Free module list nodes during shutdownValidation
meson setup build && meson test -C buildmesonis not installed on this runner (meson: command not found)Notes