Skip to content

Commit 9181eb7

Browse files
committed
Free an arena
1 parent 8be9f79 commit 9181eb7

File tree

1 file changed

+5
-0
lines changed
  • ruby/ext/google/protobuf_c

1 file changed

+5
-0
lines changed

ruby/ext/google/protobuf_c/defs.c

+5
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ static VALUE Descriptor_to_proto(VALUE _self) {
466466
const char* serialized = google_protobuf_DescriptorProto_serialize(
467467
proto, arena, &size);
468468
VALUE proto_class = rb_path2class("Google::Protobuf::DescriptorProto");
469+
upb_Arena_Free(arena);
469470
return Message_decode_bytes(size, serialized, 0, proto_class, false);
470471
}
471472

@@ -1012,6 +1013,7 @@ static VALUE FieldDescriptor_to_proto(VALUE _self) {
10121013
size_t size;
10131014
const char* serialized = google_protobuf_FieldDescriptorProto_serialize(
10141015
proto, arena, &size);
1016+
upb_Arena_Free(arena);
10151017
VALUE proto_class = rb_path2class("Google::Protobuf::FieldDescriptorProto");
10161018
return Message_decode_bytes(size, serialized, 0, proto_class, false);
10171019
}
@@ -1168,6 +1170,7 @@ static VALUE OneOfDescriptor_to_proto(VALUE _self) {
11681170
size_t size;
11691171
const char* serialized = google_protobuf_OneofDescriptorProto_serialize(
11701172
proto, arena, &size);
1173+
upb_Arena_Free(arena);
11711174
VALUE proto_class = rb_path2class("Google::Protobuf::OneofDescriptorProto");
11721175
return Message_decode_bytes(size, serialized, 0, proto_class, false);
11731176
}
@@ -1554,6 +1557,7 @@ static VALUE ServiceDescriptor_to_proto(VALUE _self) {
15541557
size_t size;
15551558
const char* serialized = google_protobuf_ServiceDescriptorProto_serialize(
15561559
proto, arena, &size);
1560+
upb_Arena_Free(arena);
15571561
VALUE proto_class = rb_path2class("Google::Protobuf::ServiceDescriptorProto");
15581562
return Message_decode_bytes(size, serialized, 0, proto_class, false);
15591563
}
@@ -1715,6 +1719,7 @@ static VALUE MethodDescriptor_to_proto(VALUE _self) {
17151719
size_t size;
17161720
const char* serialized = google_protobuf_MethodDescriptorProto_serialize(
17171721
proto, arena, &size);
1722+
upb_Arena_Free(arena);
17181723
VALUE proto_class = rb_path2class("Google::Protobuf::MethodDescriptorProto");
17191724
return Message_decode_bytes(size, serialized, 0, proto_class, false);
17201725
}

0 commit comments

Comments
 (0)