Download User's Guide
Transcript
FREE_NULL
FREE_NULL
Freeing NULL pointer
This error is generated whenever an attempt is made to de-allocate memory using
the NULL pointer.
Problem
Error Codes
This code attempts to free the pointer a, which has never been assigned. Since this
is a global variable, it is initialized to zero by default. This results in the code
attempting to free a NULL pointer.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
260
/*
* File: freenull.c
*/
char *a;
main()
{
free(a);
return (0);
}