Well, imo, the segfault you get at this point is not because you try to free memory which you have not allocated before, the segfault occurs because you try to reference a memory address which the operating system has not granted you permission you to you (that is the definition of a segmentation fault).
Some experiments, say you would run your sample code in valgrind, you would get this as output:
==6945== Invalid free() / delete / delete[]
==6945== at 0x402265C: free (vg_replace_malloc.c:323)
==6945== by 0x80483D5: main (bla.c:6)
==6945== Address 0x7 is not stack'd, malloc'd or (recently) free'd
==6945==
==6945== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 11 from 1)
==6945== malloc/free: in use at exit: 4 bytes in 1 blocks.
==6945== malloc/free: 1 allocs, 1 frees, 4 bytes allocated.
So this is a memory leak 'pur sang'. Now suppose you would change the code so the pointer you try to free is 'near' the pointer you allocated (so the operating system still know you have access to it, operating system don't grant memory access on byte boundaries). Say we modify the code like this:
int main(){
int* c;
c = (int*)malloc(sizeof(int));
c++;
free(c);
return 0;
}
When running this application you would not longer get a segmentation fault (emitted by the kernel) but a warning from glibc (the owner of malloc() and free() )
edb@Flying-Spaghetti-Monster:/tmp$ ./a.out
*** glibc detected *** ./a.out: free(): invalid pointer: 0x0804a00c ***
... followed by a trace
So you're trying to free some memory of which the kernel know it belongs to you, but of which glibc can't remember handing it out to you. If you would run this in valgrind (which operates by replacing the free(), malloc(), realloc(), ... function in libc and performing accounting on its own) you would get this output:
==6955== Invalid free() / delete / delete[]
==6955== at 0x402265C: free (vg_replace_malloc.c:323)
==6955== by 0x80483D2: main (bla.c:5)
==6955== Address 0x418a02c is 0 bytes after a block of size 4 alloc'd
==6955== at 0x4022AB8: malloc (vg_replace_malloc.c:207)
==6955== by 0x80483C0: main (bla.c:3)
==6955==
==6955== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 11 from 1)
==6955== malloc/free: in use at exit: 4 bytes in 1 blocks.
==6955== malloc/free: 1 allocs, 1 frees, 4 bytes allocated.