Skip to content
REFERENCE

mismatched-release

Default severity: error · Identifier: weavec::mismatched-release

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/reallocfree, fopenfclose, opendirclosedir, …), even when the release went through a wrapper defined in the program. Note: allocated here.

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.

Diagnostic controls · Checked guarantees