Skip to content

Commit e8b78f8

Browse files
acozzettehaberman
andauthored
Fixed memory leak of Ruby arena objects. (#8465)
In our free() method, we were freeing the memory from the upb arena but we were failing to free the memory for the Ruby arena object. This was causing every Ruby arena object to leak: even though the objects were getting GC'd, the underlying memory was not getting released. Co-authored-by: Joshua Haberman <[email protected]>
1 parent 7689f00 commit e8b78f8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: ruby/ext/google/protobuf_c/protobuf.c

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static void Arena_mark(void *data) {
180180
static void Arena_free(void *data) {
181181
Arena *arena = data;
182182
upb_arena_free(arena->arena);
183+
xfree(arena);
183184
}
184185

185186
static VALUE cArena;

0 commit comments

Comments
 (0)