You allocate memory correctly for each row in the array, but then you are not using that memory. Instead, you change the char*
pointers in each of the five elements of the array to point to the string literals "a", "b", "c", etc.
So, you have lost references to the original memory that you allocated, and instead you are trying to free memory that does not belong to you.
Instead of assigning pointers to strings as follows:
letters[0] = "a";
you must copy the string to the allocated memory, for example:
strncpy(letters[0], "a", 2);
source share