Skip to content

Commit

Permalink
Hash#dup didn't check if internal khash is initialized; fix #3609
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Apr 18, 2017
1 parent 7614939 commit c396184
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ mrb_hash_dup(mrb_state *mrb, mrb_value hash)
ret = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class);
ret->ht = kh_init(ht, mrb);

if (kh_size(h) > 0) {
if (h && kh_size(h) > 0) {
ret_h = ret->ht;

for (k = kh_begin(h); k != kh_end(h); k++) {
Expand Down

0 comments on commit c396184

Please sign in to comment.