C allows implict casting of void* to any other kind of pointer. Hence, you never need to cast the return from a malloc if you're storing it in a pointer.
C++, however, does not allow this. So, if for some reason you're calling malloc rather than new in C++, you need to cast.