When I set dataSourceName with a wrong username or a wrongpassword. This demo code will lead a memory leak.
func main() {
db, err := sqlx.Open("oci8", "xxx/xxx@127.0.0.1:1521/orcl")
if err != nil {
panic(err)
}
for {
var i int
err = db.Get(&i, "select 1 from dual")
if err != nil {
log.Println(err)
}
}
}
It seems that func (oci8Driver *OCI8DriverStruct) Open(dsnString string) (driver.Conn, error) doesn't free the resources when C.OCISessionBegin( ... return -1.
When I set dataSourceName with a wrong username or a wrongpassword. This demo code will lead a memory leak.
It seems that
func (oci8Driver *OCI8DriverStruct) Open(dsnString string) (driver.Conn, error)
doesn't free the resources whenC.OCISessionBegin( ...
return -1.