free leaked schema string in GetFilename

This commit is contained in:
dxbjavid
2026-06-11 15:22:46 +05:30
parent 379319c0d8
commit a3cd5cd6fd

View File

@@ -2069,7 +2069,9 @@ func (c *SQLiteConn) GetFilename(schemaName string) string {
if schemaName == "" { if schemaName == "" {
schemaName = "main" 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. // GetLimit returns the current value of a run-time limit.