Fix memory leak in ExpandedSQL (#738)

Fixes: #733
This commit is contained in:
Gert-Jan Timmer
2019-08-22 14:55:11 +02:00
committed by GitHub
parent e3726ad6eb
commit d3c690956b

View File

@@ -89,6 +89,7 @@ func fillExpandedSQL(info *TraceInfo, db *C.sqlite3, pStmt unsafe.Pointer) {
} }
expSQLiteCStr := C.sqlite3_expanded_sql((*C.sqlite3_stmt)(pStmt)) expSQLiteCStr := C.sqlite3_expanded_sql((*C.sqlite3_stmt)(pStmt))
defer C.sqlite3_free(unsafe.Pointer(expSQLiteCStr))
if expSQLiteCStr == nil { if expSQLiteCStr == nil {
fillDBError(&info.DBError, db) fillDBError(&info.DBError, db)
return return