Skip to content

Remove leftover memory alloc test in deflateinit#2092

Merged
Dead2 merged 1 commit intodevelopfrom
init-cleanup
Jan 11, 2026
Merged

Remove leftover memory alloc test in deflateinit#2092
Dead2 merged 1 commit intodevelopfrom
init-cleanup

Conversation

@Dead2
Copy link
Copy Markdown
Member

@Dead2 Dead2 commented Jan 10, 2026

deflateinit was still checking for failed secondary allocations, this is
no longer necessary as we only allocate a single buffer and has already been checked for failure before this.

no longer necessary as we only allocate a single buffer and has already
been checked for failure before this.
@Dead2 Dead2 added the cleanup Improving maintainability or removing code. label Jan 10, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 10, 2026

Walkthrough

A memory validation block in deflateInit2 that checked for null pointers in allocated buffers (s->window, s->prev, s->head, s->pending_buf) and performed error cleanup was removed. The function now proceeds without this explicit early validation.

Changes

Cohort / File(s) Summary
Memory validation removal
deflate.c
Removed early null-pointer check block (7 lines) in deflateInit2 that validated buffer allocations and triggered error handling on failure

Suggested reviewers

  • nmoinvaz
  • KungFuJesus
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing a leftover memory allocation test in deflateinit.
Description check ✅ Passed The description is directly related to the changeset, explaining why the memory check is being removed and its current redundancy.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch init-cleanup

📜 Recent review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48d75a5 and 4a16e11.

📒 Files selected for processing (1)
  • deflate.c
💤 Files with no reviewable changes (1)
  • deflate.c

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.36%. Comparing base (48d75a5) to head (4a16e11).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2092      +/-   ##
===========================================
+ Coverage    84.25%   85.36%   +1.11%     
===========================================
  Files          155      155              
  Lines        12862    12857       -5     
  Branches      3114     3113       -1     
===========================================
+ Hits         10837    10976     +139     
+ Misses        1042      912     -130     
+ Partials       983      969      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dead2 Dead2 merged commit 2997785 into develop Jan 11, 2026
322 checks passed
@Dead2 Dead2 mentioned this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Improving maintainability or removing code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants