Skip to content

free leaked schema string in GetFilename#1408

Open
dxbjavid wants to merge 1 commit into
mattn:masterfrom
dxbjavid:getfilename-cstring-leak
Open

free leaked schema string in GetFilename#1408
dxbjavid wants to merge 1 commit into
mattn:masterfrom
dxbjavid:getfilename-cstring-leak

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

GetFilename hands the result of C.CString straight to sqlite3_db_filename, which only borrows the pointer, so the allocation is never released and a little C heap is leaked on every call. It is the only place in the package that builds a C string for an sqlite3 call without a matching free, the siblings all defer it. Stored the pointer and freed it the same way so the schema name no longer leaks.

@codecov-commenter

codecov-commenter commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.57%. Comparing base (18cdded) to head (a3cd5cd).
⚠️ Report is 100 commits behind head on master.

Files with missing lines Patch % Lines
sqlite3.go 0.00% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1408      +/-   ##
==========================================
+ Coverage   47.16%   51.57%   +4.41%     
==========================================
  Files          12       13       +1     
  Lines        1533     1869     +336     
==========================================
+ Hits          723      964     +241     
- Misses        669      744      +75     
- Partials      141      161      +20     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants