Skip to content

Conversation

@vojtechtrefny
Copy link
Member

@vojtechtrefny vojtechtrefny commented Feb 2, 2026

We really need to move everything to autofree...

Summary by CodeRabbit

  • Bug Fixes
    • Improved resource cleanup in device management operations to ensure proper release of system resources during error conditions, enhancing system stability.

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

Two plugin files are modified to improve resource cleanup in error paths. The crypto plugin now properly frees crypt_device objects before returning on unsupported LUKS versions, and the dm plugin adds cleanup of device mapping task lists before early exits.

Changes

Cohort / File(s) Summary
Resource Cleanup in Error Paths
src/plugins/crypto.c, src/plugins/dm.c
Added crypt_free(cd) and DM task list destruction before returning in error conditions to prevent resource leaks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'More memory leaks fixes' accurately reflects the changeset, which adds resource cleanup (crypt_free and dm task list destruction) to prevent memory leaks in two functions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

I'd prefer this to be replaced by g_autofree().

Copy link
Member

@tbzatek tbzatek left a comment

Choose a reason for hiding this comment

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

Nice! 🪓

@vojtechtrefny vojtechtrefny merged commit 1fbf7a8 into storaged-project:master Feb 3, 2026
45 checks passed
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.

3 participants