--- CBOR-XS/XS.xs 2023/09/08 06:01:12 1.78 +++ CBOR-XS/XS.xs 2023/09/08 06:05:01 1.79 @@ -1245,7 +1245,7 @@ { AV *av = (AV *)sv; sv = newRV_noinc (&PL_sv_undef); - av_push (av, sv); + av_push (av, SvREFCNT_inc_NN (sv)); } else if (sv == &PL_sv_undef) // not yet decoded, but cycles not allowed ERR ("cyclic CBOR data structure found, but allow_cycles is not enabled");