Skip to content

Fix error handling and resource cleanup in UPB UnknownFieldSet.#28196

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_938066907
Draft

Fix error handling and resource cleanup in UPB UnknownFieldSet.#28196
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_938066907

Conversation

@copybara-service

Copy link
Copy Markdown

Fix error handling and resource cleanup in UPB UnknownFieldSet.

The UPB implementation of UnknownFieldSet now correctly handles errors during the creation and appending of UnknownField objects. This includes checking the return value of PyList_Append and using Py_CLEAR instead of Py_DECREF on self->fields in error paths to prevent potential double-free issues. New tests are added to verify error propagation and resource cleanup.

#12 and #13 bug in #26596

The UPB implementation of UnknownFieldSet now correctly handles errors during the creation and appending of UnknownField objects. This includes checking the return value of PyList_Append and using Py_CLEAR instead of Py_DECREF on self->fields in error paths to prevent potential double-free issues. New tests are added to verify error propagation and resource cleanup.

#12 and #13 bug in #26596

PiperOrigin-RevId: 938066907
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.

1 participant