REFERENCE
mismatched-release
Default severity: error · Identifier: weavec::mismatched-release
What it means
Section titled “What it means”A resource is released (or moved into a consuming parameter) by a function of another release family (RFC 0007): '<p>' is released with 'free' but must be released with 'fclose'. Both names are family names, the canonical releaser of the allocator (malloc/strdup/realloc → free, fopen → fclose, opendir → closedir, …), even when the release went through a wrapper defined in the program. Note: allocated here.
How to resolve it
Section titled “How to resolve it”Pair the resource with its allocator’s release family: malloc with free, fopen with fclose, and opendir with closedir. For a custom family, express the contract with WEAVEC_OWNED and WEAVEC_OWNED_BY and ensure wrapper bodies agree.