From aa952cbedb7bd7da3e879ee84b711f0dd1bc4d9f Mon Sep 17 00:00:00 2001 From: J2ObjC Team Date: Thu, 25 Jun 2026 09:57:38 -0700 Subject: [PATCH] Fix memory leak in J2ObjC runtime CGPNewRepeatedFieldArray. Release the temporary list wrapper allocated by CGPNewRepeatedFieldList before returning the result array. This prevents leaking the list and its contained proto messages in MRR mode. PiperOrigin-RevId: 938043521 --- protobuf/runtime/src/com/google/protobuf/RepeatedField.m | 1 + 1 file changed, 1 insertion(+) diff --git a/protobuf/runtime/src/com/google/protobuf/RepeatedField.m b/protobuf/runtime/src/com/google/protobuf/RepeatedField.m index 90a090af6d..766cf241cf 100644 --- a/protobuf/runtime/src/com/google/protobuf/RepeatedField.m +++ b/protobuf/runtime/src/com/google/protobuf/RepeatedField.m @@ -284,6 +284,7 @@ @interface CGPStringAsByteStringList : JavaUtilAbstractList { for (id object in list) { [result addObject:object]; } + RELEASE_(list); return result; }