Skip to content

Fix Azure example to set NULL after free#10805

Open
embhorn wants to merge 1 commit into
wolfSSL:masterfrom
embhorn:gh10800
Open

Fix Azure example to set NULL after free#10805
embhorn wants to merge 1 commit into
wolfSSL:masterfrom
embhorn:gh10800

Conversation

@embhorn

@embhorn embhorn commented Jun 29, 2026

Copy link
Copy Markdown
Member

Description

Fix Azure example to set NULL after free

Fixes #10800

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a shutdown-path double-free bug in the Azure Sphere TLS server example by ensuring the per-connection WOLFSSL* ssl pointer is cleared after it is freed, so the final shared cleanup routine can safely run without re-freeing the same object.

Changes:

  • Set ssl = NULL immediately after wolfSSL_free(ssl) inside the connection loop to prevent a subsequent util_Cleanup(sockfd, ctx, ssl) from double-freeing ssl.

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

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.

[Bug]: Double free of ssl in Azure Sphere server example on the shutdown path

2 participants