Skip to content

Conversation

NoahStapp
Copy link
Contributor

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!

@blink1073
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants