invalid-release
Default severity: error · Identifier: weavec::invalid-release
What it means
Section titled “What it means”A releaser (or a consuming parameter) is handed a pointer that is not the start of a heap allocation (RFC 0008): '<p>' is released but points to '<x>', which is not a heap object (a stack or static variable, an array, a field of one; '<x>' is released but is not a heap object when <p> is <x> itself), '<p>' is released but points to a string literal, '<p>' is released but points 4 elements past the start of its allocation / points to field 'in' of its allocation / does not point to the start of its allocation (p + 1, strchr(p, c), p++, &o->in; the offset is named when the checker knows it, RFC 0011). Notes: '<x>' is declared here / allocated here.
How to resolve it
Section titled “How to resolve it”Release the original allocation base with the correct releaser. Stack objects, string literals, and interior pointers are not independently freeable. Keep the owning base separate from traversal cursors.