Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory leaks in PrepareStatementDB #7142

Merged
merged 4 commits into from
Aug 22, 2024
Merged

fix memory leaks in PrepareStatementDB #7142

merged 4 commits into from
Aug 22, 2024

Conversation

ivila
Copy link
Contributor

@ivila ivila commented Aug 7, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Fix the issue #7137

User Case Description

Just fix the memory leaks.

prepare_stmt.go Outdated Show resolved Hide resolved
prepare_stmt.go Show resolved Hide resolved
1) Fix potential Segmentation Fault in Reset function
2) Setting db.Stmts to nil map when Close to avoid further using
@ivila ivila requested a review from a631807682 August 7, 2024 07:31
@a631807682
Copy link
Member

Can you add some unit tests in tests/prepared_stmt_test.go?

Zehui Chen added 2 commits August 7, 2024 19:01
1) TestPreparedStmtConcurrentReset
2) TestPreparedStmtConcurrentClose
@ivila
Copy link
Contributor Author

ivila commented Aug 7, 2024

Can you add some unit tests in tests/prepared_stmt_test.go?

Done, anything else?

@jinzhu jinzhu merged commit 0dbfda5 into go-gorm:master Aug 22, 2024
31 checks passed
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.

3 participants