o->items = rb_ary_new2 (vc->comments);
for (i = 0; i < vc->comments; i++) {
- VALUE k, v;
+ VALUE k, v, pair;
char *ptr, *content = vc->user_comments[i];
ptr = strchr (content, '=');
v = rb_str_new2 (ptr + 1);
- rb_ary_store (o->items, i,
- rb_ary_new3 (2, k, v));
+ pair = rb_ary_new3 (2, k, v);
+ OBJ_FREEZE (pair);
+
+ rb_ary_store (o->items, i, pair);
}
rb_iv_set (self, "@items", o->items);
static VALUE
c_aset (VALUE self, VALUE key, VALUE value)
{
+ VALUE tmp;
RbVorbisComments *o;
struct RArray *items;
int i;
}
}
- rb_ary_push (o->items, rb_ary_new3 (2, key, value));
+ tmp = rb_ary_new3 (2, key, value);
+ OBJ_FREEZE (tmp);
+
+ rb_ary_push (o->items, tmp);
return value;
}