A pointer pointing to a invalid memory location is known as wild pointer it is most of the cases occurs when we use an Uninitialized pointers or freed pointer, which may point to some arbitrary memory location and may cause a program to crash or behave badly.
See the following program which will explain -
int main()
{
int *p; /* Here P is wild pointer */
*p = 12; /* Some unknown memory location is being corrupted and This should never be done. */
}
How to Avoid Wild Pointer
Following program would explain how to avoid WIld Pointer.
int main()
{
int *p = malloc(sizeof(int));
*p = 12; /* This is safe */
free(p);
p=NULL; /* we are marking P to NULL so that in rest of the program P is not used */
}