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 in realloc failure handling #22188

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

visitorckw
Copy link
Contributor

Description

In the qp_lvgl_attach function, when reallocating memory for the color_buffer, we were not properly handling the case when realloc fails, leading to potential memory leaks. This change ensures that memory is properly managed, and potential memory leaks are prevented in the qp_lvgl_attach function.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Oct 2, 2023
@tzarc tzarc requested a review from a team October 2, 2023 22:46
@tzarc tzarc added the bug label Oct 2, 2023
@visitorckw visitorckw force-pushed the fix-memory-leak branch 2 times, most recently from e07a269 to 14dce44 Compare October 3, 2023 13:51
In the qp_lvgl_attach function, when reallocating memory for the
color_buffer, we were not properly handling the case when realloc fails,
leading to potential memory leaks. This change ensures that memory is
properly managed, and potential memory leaks are prevented in the
qp_lvgl_attach function.
@tzarc tzarc merged commit 3df155f into qmk:develop Oct 3, 2023
4 checks passed
mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Oct 25, 2023
christrotter pushed a commit to christrotter/qmk_firmware that referenced this pull request Nov 28, 2023
zgagnon pushed a commit to zgagnon/qmk_firmware_waterfowl that referenced this pull request Dec 15, 2023
future-figs pushed a commit to future-figs/qmk_firmware that referenced this pull request Dec 27, 2023
mute-civilian pushed a commit to mute-civilian/qmk_firmware that referenced this pull request Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants