Fixed a memory bug with RepeatedField#+.

We need to fuse the arrays so that the second array's data
stays live.
pull/8970/head
Joshua Haberman 3 years ago
parent 605ab956e0
commit 79ac88bbbb
  1. 1
      ruby/ext/google/protobuf_c/repeated_field.c

@ -551,6 +551,7 @@ VALUE RepeatedField_plus(VALUE _self, VALUE list) {
RepeatedField* dupped = ruby_to_RepeatedField(dupped_);
upb_array *dupped_array = RepeatedField_GetMutable(dupped_);
upb_arena* arena = Arena_get(dupped->arena);
Arena_fuse(list_rptfield->arena, arena);
int size = upb_array_size(list_rptfield->array);
int i;

Loading…
Cancel
Save