Fix test.

This commit is contained in:
Nuno Cruces
2023-02-06 01:29:54 +00:00
parent 1593aae62d
commit a66e454703
2 changed files with 2 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ func (c *Conn) new(len uint32) uint32 {
panic(err)
}
ptr := uint32(r[0])
if ptr == 0 {
if ptr == 0 && len != 0 {
panic(oomErr)
}
return ptr

View File

@@ -114,7 +114,7 @@ func TestConn_free(t *testing.T) {
db.free(0)
ptr := db.new(0)
ptr := db.new(1)
if ptr == 0 {
t.Error("got nullptr, want a pointer")
}