Repository navigation
Release previous item reference in cbor_tag_set_item() - #391
Merged
Merged
Conversation
cbor_tag_set_item() did not decref the previous tagged item when replacing it, leaking the reference. Now it decrefs the old item before setting the new one, consistent with cbor_array_replace(). This is a breaking change for callers that manually released the old item before calling cbor_tag_set_item. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #391 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 1659 1661 +2
=========================================
+ Hits 1659 1661 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
cbor_tag_set_item()did not decref the previous tagged item when replacing it, leaking the referencecbor_array_replace()Breaking change
Previously, replacing the tagged item would leak the old item's reference. If callers were manually releasing the old item before calling
cbor_tag_set_item, they should remove the extracbor_decref.Test plan
test_set_item_replaces_previousverifying refcounts are correctly updated when replacing a tagged item🤖 Generated with Claude Code