From d3c690956bde8789300d0dd7e868189cb88cf6ad Mon Sep 17 00:00:00 2001 From: Gert-Jan Timmer Date: Thu, 22 Aug 2019 14:55:11 +0200 Subject: [PATCH] Fix memory leak in ExpandedSQL (#738) Fixes: #733 --- sqlite3_trace.go | 1 + 1 file changed, 1 insertion(+) diff --git a/sqlite3_trace.go b/sqlite3_trace.go index ee93a0f..51cb22e 100644 --- a/sqlite3_trace.go +++ b/sqlite3_trace.go @@ -89,6 +89,7 @@ func fillExpandedSQL(info *TraceInfo, db *C.sqlite3, pStmt unsafe.Pointer) { } expSQLiteCStr := C.sqlite3_expanded_sql((*C.sqlite3_stmt)(pStmt)) + defer C.sqlite3_free(unsafe.Pointer(expSQLiteCStr)) if expSQLiteCStr == nil { fillDBError(&info.DBError, db) return