X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpdf-scheme.cc;h=13e8389ecec7b42a1831c4001090b25ff54e9474;hb=05f05a51ca0078ce9a8c87cbf30ac7fbd4def706;hp=ecfe5c4f01d2e973cfedf9648a9274031957ebb9;hpb=bb8a0a5387af94dd2702877256334b160575a730;p=lilypond.git diff --git a/lily/pdf-scheme.cc b/lily/pdf-scheme.cc index ecfe5c4f01..13e8389ece 100644 --- a/lily/pdf-scheme.cc +++ b/lily/pdf-scheme.cc @@ -58,11 +58,11 @@ LY_DEFINE (ly_encode_string_for_pdf, "ly:encode-string-for-pdf", * though), we have to prepend it manually. */ if (g_without_BOM) // conversion to UTF-16be might have failed (shouldn't!) { - g = new char[bytes_written + 3]; + g = (char*)malloc ( sizeof(char) * (bytes_written + 3)); char const *BOM = "\xFE\xFF"; strcpy (g, BOM); memcpy (&g[2], g_without_BOM, bytes_written + 1); // Copy string + \0 - free (g_without_BOM); + g_free (g_without_BOM); bytes_written += 2; } }