c strcat whith malloc pointer

I'm trying to use pointers which is malloc and strcat from C. here is my try:enter image description here

i get the result enter image description here

why the result is correct? why not outside index? i only malloc memory that size equals to the pointer of name , why the pointer of change can strcat the pointer of renyi?