Bug report
Bug description:
Public issue regarding the issue found by @sushi-gif. Here is a summary of the discussion:
The function sqlite3.Connection.load_extension() has a minor memory leak that occurs when SQLite throws an error while loading an extension (sqlite3_load_extension). According to SQLite specifications, the buffer of the error message must be freed manually after use. The attached PR fixes the issue.
Reproduction code:
import sqlite3
cx = sqlite3.connect(":memory:")
cx.enable_load_extension(True)
for _ in range(1000000):
try:
cx.load_extension("does_not_exist")
except sqlite3.Error:
pass
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
Public issue regarding the issue found by @sushi-gif. Here is a summary of the discussion:
The function sqlite3.Connection.load_extension() has a minor memory leak that occurs when SQLite throws an error while loading an extension (sqlite3_load_extension). According to SQLite specifications, the buffer of the error message must be freed manually after use. The attached PR fixes the issue.
Reproduction code:
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs