Code:
 
char* p = malloc(20);

char *q = p;

p = p + 5;

//do stuff

free(q);
The above changes would be sufficient - you could do it many different ways, but if you modify the return value from malloc, you need to save it away so that you can free the same thing. As Salem said, it will most likely crash - but worse possibility is that it doesn't crash when you free, but perhaps it crashes next time you malloc, or some 20 malloc's later when the corrupted data that got stored back into the heap is needed again - those bugs can be VERY hard to find. So being careful about freeing exactly the same thing that you malloc'd is a good idea.

--
Mats