Skip to content

Commit

Permalink
MemoryView: ensure reset rb_memory_view_t::obj on error
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 18, 2021
1 parent bddca7c commit 0ed3934
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/fiddle/memory_view.c
Expand Up @@ -109,6 +109,7 @@ rb_fiddle_memview_initialize(VALUE obj, VALUE target)
TypedData_Get_Struct(obj, struct memview_data, &fiddle_memview_data_type, data);

if (!rb_memory_view_get(target, &data->view, 0)) {
data->view.obj = Qnil;
rb_raise(rb_eArgError, "Unable to get a memory view from %+"PRIsVALUE, target);
}

Expand Down

0 comments on commit 0ed3934

Please sign in to comment.