Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates test cleanup paths to use wolfSSL’s allocator/free macros consistently, addressing invalid frees in nightly memory tests.
Changes:
- Replace
free()withXFREE()for buffers presumed to be allocated viaXMALLOC()/load_file(). - Align test teardown with wolfSSL memory tracking to reduce
free(): invalid pointererrors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/api/test_pkcs7.c | Switches cert_buf deallocation from free() to XFREE() in a PKCS7 decode test cleanup path. |
| tests/api.c | Switches serverKey deallocation from free() to XFREE() in two dual-alg test cleanup paths. |
Comments suppressed due to low confidence (1)
tests/api.c:1
XFREE's third argument (dynamic type) should match the type used when allocatingserverKey(likely insideload_file()). Ifload_file()uses a differentDYNAMIC_TYPE_*for this buffer, this change can still cause allocator/debug-tracking issues even if it compiles. Please update theDYNAMIC_TYPE_*here to exactly match the allocation site’s type (or use a dedicatedload_file_free()helper to centralize the correctXFREEparameters).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Retest this please. Unclear what is cause of error. |
JacobBarthelmeh
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Use XFREE for buffer that came from XMALLOC in
load_file().Fixes some
free(): invalid pointererrors from mem test.Testing: