fix memory bug in perl binding

This commit is contained in:
Sears Russell 2009-12-10 02:38:31 +00:00
parent efc6a0eabd
commit 230d863ff7

View file

@ -47,9 +47,7 @@ sub TIEHASH {
sub FETCH { sub FETCH {
my $this = shift; my $this = shift;
my $key = shift; my $key = shift;
my $ret = Stasis::ThashLookup($$this{xid}, $$this{rid}, $key); return Stasis::ThashLookup($$this{xid}, $$this{rid}, $key);
## Oddly, returning without the defined() check leads to a segfault(??)
if(defined($ret)) { return $ret; } else { return; }
} }
sub STORE { sub STORE {
my $this = shift; my $this = shift;
@ -291,7 +289,7 @@ SV* stasis_perl_ThashLookup(int xid, recordid hash, SV * key) {
free(valb); free(valb);
return ret; return ret;
} else { } else {
return 0; return &PL_sv_undef;
} }
} }