Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PYTHON-5571 - Fix memory leak when raising InvalidDocument with C extensions #2573

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

Merged
NoahStapp merged 1 commit into mongodb:master from NoahStapp:PYTHON-5571
Oct 6, 2025

Conversation

Copy link
Contributor

@NoahStapp NoahStapp commented Oct 3, 2025

We previously redeclared msg, new_msg, and new_evalue. This shadowed the initial declarations and leaked memory at cleanup. This PR removes that shadowing and transfers ownership of new_evalue's reference correctly.

@NoahStapp NoahStapp requested a review from a team as a code owner October 3, 2025 14:51
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

drivers-pr-bot please backport to v4.15

@NoahStapp NoahStapp merged commit 52400e1 into mongodb:master Oct 6, 2025
76 of 79 checks passed
Copy link
Contributor

Sorry, unable to cherry-pick to v4.15, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout -b cherry-pick-v4.15-52400e11a1ac69bcc89dfe5a034df00a4a7f690c v4.15
git fetch origin 52400e11a1ac69bcc89dfe5a034df00a4a7f690c
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 52400e11a1ac69bcc89dfe5a034df00a4a7f690c
  1. You will likely have some merge/cherry-pick conflicts here, fix them and commit:
git commit -am {message}
  1. Push to a named branch:
git push origin cherry-pick-v4.15-52400e11a1ac69bcc89dfe5a034df00a4a7f690c
  1. Create a PR against branch v4.15. I would have named this PR:

"PYTHON-5571 - Fix memory leak when raising InvalidDocument with C extensions (#2573) [v4.15]"

blink1073 pushed a commit to blink1073/mongo-python-driver that referenced this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@blink1073 blink1073 blink1073 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /