Skip to content

Add atl_free() for cross-DLL memory management on Windows#41

Merged
eisenhauer merged 1 commit into
GTkorvo:masterfrom
eisenhauer:add-atl-free
Jan 25, 2026
Merged

Add atl_free() for cross-DLL memory management on Windows#41
eisenhauer merged 1 commit into
GTkorvo:masterfrom
eisenhauer:add-atl-free

Conversation

@eisenhauer

Copy link
Copy Markdown
Member

Summary

On Windows, each DLL can have its own CRT heap. Memory allocated by ATL functions like attr_list_to_string() and atl_base64_encode() must be freed by ATL, not by the calling application, to avoid heap corruption (_CrtIsValidHeapPointer assertion failures).

This PR adds an atl_free() function that callers should use to free strings returned by ATL functions.

Changes

  • Add atl_free(void *ptr) function declaration to atl.h with documentation
  • Add atl_free() implementation to attr.c
  • Bump version to 2.3.0

Test plan

  • Verified fix resolves heap corruption in EVPath Windows port tests
  • CI passes

🤖 Generated with Claude Code

On Windows, each DLL can have its own CRT heap. Memory allocated by
ATL functions like attr_list_to_string() and atl_base64_encode() must
be freed by ATL, not by the calling application, to avoid heap
corruption.

Add atl_free() function that callers should use to free strings
returned by ATL functions.

Bump version to 2.3.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@eisenhauer eisenhauer merged commit fe13594 into GTkorvo:master Jan 25, 2026
27 of 41 checks passed
@eisenhauer eisenhauer deleted the add-atl-free branch January 25, 2026 20:07
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.

1 participant