Correct malloc buffer size

Previously was allocating sizeof(char *) rather than sizeof(char),
so we save some space here.