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 leak dumping on non-string dict keys #521

Merged

Conversation

JustAnotherArchivist
Copy link
Collaborator

For bytes, there was an extraneous INCREF; PyIter_Next returns a new reference. For other non-strings, the original itemName before converting to a string was never dereferenced.

Fixes #419

For bytes, there was an extraneous INCREF; PyIter_Next returns a new reference. For other non-strings, the original itemName before converting to a string was never dereferenced.

Fixes ultrajson#419
@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2022

Codecov Report

Merging #521 (f473914) into main (f6860f1) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #521      +/-   ##
==========================================
+ Coverage   90.63%   90.69%   +0.06%     
==========================================
  Files           6        6              
  Lines        1783     1784       +1     
==========================================
+ Hits         1616     1618       +2     
+ Misses        167      166       -1     
Impacted Files Coverage Δ
python/objToJSON.c 87.31% <100.00%> (+0.27%) ⬆️
tests/test_ujson.py 99.58% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6860f1...f473914. Read the comment docs.

@bwoodsend bwoodsend changed the title Fix ref counting on non-string dict keys Fix memory leak dumping on non-string dict keys Apr 7, 2022
@bwoodsend bwoodsend added the changelog: Fixed For any bug fixes label Apr 7, 2022
@bwoodsend bwoodsend merged commit 62dec8d into ultrajson:main Apr 7, 2022
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Fixed For any bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak in ujson.dumps ?
3 participants