Skip to content

F-1118 fixed memory leak in realloc#229

Merged
cconlon merged 1 commit into
wolfSSL:mainfrom
stenslae:1118-mem-leak
May 29, 2026
Merged

F-1118 fixed memory leak in realloc#229
cconlon merged 1 commit into
wolfSSL:mainfrom
stenslae:1118-mem-leak

Conversation

@stenslae
Copy link
Copy Markdown
Member

Assigned the XREALLOC result to a temporary pointer first, and XFREE is called on failure.

@stenslae stenslae self-assigned this May 27, 2026
@cconlon cconlon requested review from Copilot and removed request for wolfSSL-Fenrir-bot May 27, 2026 22:25
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #229

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix a memory leak on XREALLOC failure in wolfCLU_getline() by using a temporary pointer and freeing the original buffer when reallocation fails.

Changes:

  • Introduces a temporary pointer (tmp) to safely handle XREALLOC results.
  • Frees the original buffer and nulls *lineptr when XREALLOC fails.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tools/clu_funcs.c Outdated
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #229

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #229

Scan targets checked: wolfclu-bugs, wolfclu-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/tools/clu_funcs.c Outdated
Comment thread src/tools/clu_funcs.c Outdated
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #229

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #229

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/tools/clu_funcs.c
@cconlon
Copy link
Copy Markdown
Member

cconlon commented May 28, 2026

@stenslae see one new copilot comment above, thanks

@cconlon cconlon assigned stenslae and unassigned cconlon May 28, 2026
@stenslae stenslae assigned cconlon and unassigned cconlon May 28, 2026
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #229

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

@stenslae stenslae assigned cconlon and unassigned stenslae May 29, 2026
@cconlon cconlon merged commit a686cec into wolfSSL:main May 29, 2026
27 checks passed
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.

4 participants