Skip to content

wincng: fix memleak on fail path in ssh2_ecdsa_verify() - #2302

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:wcng-leak
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:wcng-leak

Conversation

@vszakats

Copy link
Copy Markdown
Member

Reported by GitHub Code Quality

Follow-up to 3e72343 #1315

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes a memory leak in the WinCNG ECDSA verification implementation by ensuring the failure path goes through the shared cleanup block in ssh2_ecdsa_verify(). This is a correctness/robustness follow-up to the earlier WinCNG ECDSA enablement work.

Changes:

  • Replaces an early return in the unsupported-curve switch default: with result = LIBSSH2_ERROR_INVAL; goto cleanup;
  • Ensures allocated signature buffer (signature_p1363) is freed consistently on all error paths

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

@vszakats vszakats closed this in a196a09 Jul 14, 2026
@vszakats
vszakats deleted the wcng-leak branch July 14, 2026 10:08
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.

2 participants