Skip to content

DAOS-18681 rebuild: fix potential memory leaks in error paths - #17899

Merged
gnailzenh merged 3 commits into
release/2.8from
shilongw/DAOS-18681-2.8
Apr 9, 2026
Merged

gnailzenh merged 3 commits into
release/2.8from
shilongw/DAOS-18681-2.8

Conversation

@wangshilong

Copy link
Copy Markdown
Contributor

Fix potential memory leaks in error cases in rebuild and IV path. Also Fixed a memmory allocation check typo to avoid potential crash

Removed stale comments

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

Fix potential memory leaks in error cases in rebuild and IV path.
Also Fixed a memmory allocation check typo to avoid potential crash

Removed stale comments

Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
@wangshilong
wangshilong requested review from a team as code owners April 3, 2026 08:36
@wangshilong
wangshilong requested review from a team April 3, 2026 08:36
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

Ticket title is 'Fix potential memory Leaks '
Status is 'In Progress'
Job should run at elevated priority (1)
https://daosio.atlassian.net/browse/DAOS-18681

@github-actions github-actions Bot added the priority Ticket has high priority (automatically managed) label Apr 3, 2026
This patch fixes several resource-handling bugs that could lead to
memory leaks or crashes(all catched by AI):

1.Avoid leaking memory allocated in tse_task_cb() when tse_task_reinit_with_delay()
fails by introducing a helper to clean up on failure.
2. Ensure sub_anchors_free() is called on error paths for enumeration and key2anchor case.
3. Invoke dc_tx_local_close() on error paths to properly close local transactions.
4. Make drpc_call() return an error when allocation fails to avoid potential
NULL dereference and segfault.

Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
@wangshilong
wangshilong requested review from a team as code owners April 3, 2026 08:40
Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
@gnailzenh
gnailzenh merged commit b65ef1a into release/2.8 Apr 9, 2026
40 checks passed
@gnailzenh
gnailzenh deleted the shilongw/DAOS-18681-2.8 branch April 9, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority Ticket has high priority (automatically managed)

Development

Successfully merging this pull request may close these issues.

3 participants