No, this is not because you are allocating an array that assumes measuring only one element of the primitive type char (which is 1 byte).
I assume that you want to highlight 5 pointers to lines inside names, but just pointers.
You must select it according to the size of the pointer times the number of elements:
char **names = malloc(sizeof(char*)*5);
. , , , **