diff
  redirection_free_data(pData, NULL);
+ size_t total_size = 0;
+ char* tok = strtok(utf8, "\r\n");
+ while (tok) {
+     size_t bplen = 0;
+     crypto_base64_decode(tok, strlen(tok), NULL, &bplen);
+     total_size += bplen;
+     tok = strtok(NULL, "\r\n");
+ }
+ *pData = malloc(total_size);
  if (!*pData)
      goto fail;
  
  // ... (reset strtok and continue with decoding)
