Changed the logic to allocate the char array for the base64 string