Skip to content

Fix unclosed ReadOnlyTransaction not detected when passed as function argument#70

Open
uji wants to merge 1 commit intogcpug:mainfrom
uji:fix/49
Open

Fix unclosed ReadOnlyTransaction not detected when passed as function argument#70
uji wants to merge 1 commit intogcpug:mainfrom
uji:fix/49

Conversation

@uji
Copy link

@uji uji commented Mar 8, 2026

Fixes #49

  • analysisutil.NotCalledIn internally skips transactions passed as function arguments (due to its isArg check), causing unclosed ReadOnlyTransaction to go undetected when passed to another function
  • Added findArgPassedUnclosedTx to complement NotCalledIn by specifically detecting unclosed transactions that are passed as arguments

analysisutil.NotCalledIn skips transactions passed as arguments due to
its internal isArg check. Add findArgPassedUnclosedTx to complement it
by detecting cases where a transaction is passed to another function
but Close() is never called.

Fixes gcpug#49
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.

unclosetx: not detect when a function called with a ReadOnlyTransaction argument

1 participant