As size of the data is predefined you can use here just char array insted of pointer to dynamically allocated memory.