bugfix: leak in db_sqlite.GetValue
This commit is contained in:
parent
fe7dd31b61
commit
8717742f00
1 changed files with 5 additions and 3 deletions
|
|
@ -130,9 +130,11 @@ proc GetValue*(db: TDbConn, query: TSqlQuery,
|
||||||
var stmt = setupQuery(db, query, args)
|
var stmt = setupQuery(db, query, args)
|
||||||
if step(stmt) == SQLITE_ROW:
|
if step(stmt) == SQLITE_ROW:
|
||||||
let cb = column_bytes(stmt, 0)
|
let cb = column_bytes(stmt, 0)
|
||||||
if cb == 0: return ""
|
if cb == 0:
|
||||||
result = newStringOfCap(cb)
|
result = ""
|
||||||
add(result, column_text(stmt, 0))
|
else:
|
||||||
|
result = newStringOfCap(cb)
|
||||||
|
add(result, column_text(stmt, 0))
|
||||||
if finalize(stmt) != SQLITE_OK: dbError(db)
|
if finalize(stmt) != SQLITE_OK: dbError(db)
|
||||||
else:
|
else:
|
||||||
result = ""
|
result = ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue