Insure++ Reference - FREE_BODY
This error is generated when an attempt is made to de-allocate memory
by using a pointer which currently points into the middle of a block,
rather than to its beginning.
The following code attempts to free a memory region using an invalid
pointer.
1: /*
2: * File: freebody.c
3: */
4: #include <stdlib.h>
5:
6: main()
7: {
8: char *a = (char *)malloc(10);
9: free(a+1);
10: }
[freebody.c:9] **FREE_BODY**
1. >> free(a+1);
2. Freeing memory block from body: a + 1
3. Pointer : 0x000173e9
Stack trace where the error occurred:
4. main() freebody.c, 9
5. **Memory corrupted. Program may crash!!**
- Source line at which the problem was detected.
- Description of the problem and the expression that is in error.
- Value of the pointer that is being deallocated.
- Stack trace showing the function call sequence leading to the
error.
- Informational message indicating that a serious error has
occurred which may cause the program to crash.
This is normally a serious error. In most cases, the line number indicated
in the diagnostics will have a simple error that can be corrected.
EXPR_WILD
FREE_DANGLING
|