fix: prevent double-decref of event in envelope add functions by jpnurmi · Pull Request #1511 · getsentry/sentry-native
and others added 2 commits
February 11, 2026 14:36Move `item->event` assignment after the payload allocation check in `sentry__envelope_add_event` and `sentry__envelope_add_transaction`. Previously, if `sentry__jsonwriter_into_string` failed, the event was already owned by the envelope item. Multiple callers decref the event and free the envelope on failure, leading to a double-decref because `sentry_envelope_free` also decrefs `item->event` via item cleanup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jpnurmi
deleted the
jpnurmi/fix/envelope-add-event
branch
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