while ( (he = hv_iternext(stash)) ) {
STRLEN keylen;
char *key = HePV(he, keylen);
- hv_store(ret, key, keylen, SvREFCNT_inc(HeVAL(he)), 0);
+ if (!hv_store(ret, key, keylen, SvREFCNT_inc(HeVAL(he)), 0)) {
+ croak("failed to store glob ref");
+ }
}
return ret;
if (sv) {
char *key = HePV(he, keylen);
- hv_store(ret, key, keylen, newRV_inc(sv), 0);
+ if (!hv_store(ret, key, keylen, newRV_inc(sv), 0)) {
+ croak("failed to store symbol ref");
+ }
}
}