SIGN IN SIGN UP

Protocol Buffers - Google's data interchange format

0 0 35 C++

[ObjC] Fix over-release in GPBTextFormatForMessage

When handling deeply nested unknown fields, the `subIndent` string was being over-released in `GPBTextFormatForMessage`, leading to crashes when generating text format for messages with deeply nested unknown fields.

The added test case reproduces this crash by creating a message with unknown fields nested deep enough to cause the indent string to be heap-allocated, and then adding siblings at that depth, triggering the incorrect release.

Removing the redundant `[subIndent release]` resolves the issue.

PiperOrigin-RevId: 895495564
P
Protobuf Team Bot committed
18f4d6130e9597bd7d553d0ae9fdff3c1995f40f
Parent: e96c5ec
Committed by Copybara-Service <copybara-worker@google.com> on 4/6/2026, 9:19:57 PM