in reply to hv_store_ent

This may be your problem.
From the perlguts manpage:

Note that both `hv_store' and `hv_store_ent' do not increment the reference count of the stored `val', which is the caller's responsibility. If these functions return a NULL value, the caller will usually have to decrement the reference count of `val' to avoid a memory leak.

Maybe create the SV with:

SV *val = sv_newmortal();
Or mortalize it with:
sv_2mortal(val);
Might work? You might need to Mortalize 'key' too.

Replies are listed 'Best First'.
Re: Re: hv_store_ent
by bmdhacks (Novice) on Jan 18, 2001 at 01:46 UTC
    Yeah, ignore the non error-checking nature of that sample code, I just did it for brevity. The motality of the 'key' SV is where my question lies. Can anyone verify that I need to kill it (or decrement it's reference count) after passing it to hv_store_ent?