We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9131f0 commit 3e3407aCopy full SHA for 3e3407a
ruby/ext/google/protobuf_c/message.c
@@ -70,6 +70,9 @@ VALUE Message_alloc(VALUE klass) {
70
msg = (MessageHeader*)ALLOC_N(uint8_t,
71
sizeof(MessageHeader) + desc->layout->size);
72
73
+ // Required in case a GC happens before layout_init().
74
+ memset(msg, 0, desc->layout->size);
75
+
76
// We wrap first so that everything in the message object is GC-rooted in case
77
// a collection happens during object creation in layout_init().
78
ret = TypedData_Wrap_Struct(klass, &Message_type, msg);
0 commit comments