[c] How to free memory from char array in C