Skip to content

Commit

Permalink
Merge pull request #8970 from haberman/ruby-repeated-plus-arena
Browse files Browse the repository at this point in the history
Fixed a memory bug with RepeatedField#+.
  • Loading branch information
haberman authored Sep 13, 2021
2 parents 39dc8ad + 79ac88b commit ac02d6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ruby/ext/google/protobuf_c/repeated_field.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ac02d6c

Please sign in to comment.