X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpdf-scheme.cc;h=1801ae286d3fa8e9ae3e02611f9f09b6730eb411;hb=3bf590e96962fc6102267e4fcab9e4b55a75bca2;hp=ecfe5c4f01d2e973cfedf9648a9274031957ebb9;hpb=4bb29573149a0ffa1f881c5e38a0fe68e9e76b67;p=lilypond.git diff --git a/lily/pdf-scheme.cc b/lily/pdf-scheme.cc index ecfe5c4f01..1801ae286d 100644 --- a/lily/pdf-scheme.cc +++ b/lily/pdf-scheme.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2011 Reinhold Kainhofer + Copyright (C) 2011--2012 Reinhold Kainhofer LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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; } }