Take the following code :
int *p = malloc(2 * sizeof *p); p[0] = 10; //Using the two spaces I p[1] = 20; //allocated with malloc before. p[2] = 30; //U
C kindly let you shoot yourself in the head. You have just used random memory on the heap. With unforeseeable consequences.
Disclaimer: My last real C programing was done some 15 years ago.