free leaked schema string in GetFilename
This commit is contained in:
@@ -2069,7 +2069,9 @@ func (c *SQLiteConn) GetFilename(schemaName string) string {
|
||||
if schemaName == "" {
|
||||
schemaName = "main"
|
||||
}
|
||||
return C.GoString(C.sqlite3_db_filename(c.db, C.CString(schemaName)))
|
||||
cSchema := C.CString(schemaName)
|
||||
defer C.free(unsafe.Pointer(cSchema))
|
||||
return C.GoString(C.sqlite3_db_filename(c.db, cSchema))
|
||||
}
|
||||
|
||||
// GetLimit returns the current value of a run-time limit.
|
||||
|
||||
Reference in New Issue
Block a user