fix memory bug in perl binding
This commit is contained in:
parent
efc6a0eabd
commit
230d863ff7
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue