Skip to content

Fixes memory leak in cbor_bytestring_add_chunk - #228

Merged
PJK merged 1 commit into
PJK:masterfrom
James-ZHANG:fix-memory-leak-in-bytestring-add-chunk
Dec 25, 2022
Merged

PJK merged 1 commit into
PJK:masterfrom
James-ZHANG:fix-memory-leak-in-bytestring-add-chunk

Conversation

@James-ZHANG

Copy link
Copy Markdown
Contributor

PR: Fixes memory leak in cbor_bytestring_add_chunk

Description

The passed chunk is not freed when cbor_bytestring_add_chunk returns false.

Checklist

  • I have read followed CONTRIBUTING.md
    • I have added tests
    • I have updated the documentation
    • I have updated the CHANGELOG
  • Are there any breaking changes? If so, are they documented?
    No
  • Does this PR introduce any platform specific code? If so, is this captured in the description?
    No
  • Security: Does this PR potentially affect security? If so, is this captured in the description?
    No
  • Performance: Does this PR potentially affect performance? If so, is this captured in the description?
    No

@James-ZHANG
James-ZHANG force-pushed the fix-memory-leak-in-bytestring-add-chunk branch from c0782c0 to 8cf378c Compare December 22, 2022 00:07
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #228 (8cf378c) into master (f8c9891) will decrease coverage by 0.31%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #228      +/-   ##
==========================================
- Coverage   95.96%   95.65%   -0.32%     
==========================================
  Files          20       20              
  Lines        1538     1543       +5     
==========================================
  Hits         1476     1476              
- Misses         62       67       +5     
Impacted Files Coverage Δ
src/cbor/bytestrings.c 94.64% <50.00%> (-3.44%) ⬇️
src/cbor/internal/builder_callbacks.c 89.28% <50.00%> (-0.41%) ⬇️
src/cbor/streaming.c 98.01% <0.00%> (-1.00%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@PJK

PJK commented Dec 25, 2022

Copy link
Copy Markdown
Owner

Nice catch, thanks!

Also filed #231 to improve test coverage

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

⌂ 换网址