diff --git a/src/add-ons/translators/rtf/Jamfile b/src/add-ons/translators/rtf/Jamfile index 83814f3824..5191eb8eb0 100644 --- a/src/add-ons/translators/rtf/Jamfile +++ b/src/add-ons/translators/rtf/Jamfile @@ -8,6 +8,8 @@ SetSubDirSupportedPlatformsBeOSCompatible ; SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ; +UsePrivateHeaders shared ; + Translator RTF-Translator : # RTFTranslator classes main.cpp diff --git a/src/add-ons/translators/rtf/convert.cpp b/src/add-ons/translators/rtf/convert.cpp index 303b0b43ae..c83199cfde 100644 --- a/src/add-ons/translators/rtf/convert.cpp +++ b/src/add-ons/translators/rtf/convert.cpp @@ -16,6 +16,8 @@ #include #include +#include + #include #include #include @@ -573,6 +575,8 @@ convert_to_stxt(RTF::Header &header, BDataIO &target) return status; } + BPrivate::MemoryDeleter _(flattenedRuns); + // put out styles TranslatorStyledTextStyleHeader styleHeader; @@ -584,7 +588,7 @@ convert_to_stxt(RTF::Header &header, BDataIO &target) status = swap_data(B_UINT32_TYPE, &styleHeader, sizeof(styleHeader), B_SWAP_HOST_TO_BENDIAN); - if (status != B_OK) + if (status != B_OK) return status; written = target.Write(&styleHeader, sizeof(styleHeader)); @@ -596,8 +600,6 @@ convert_to_stxt(RTF::Header &header, BDataIO &target) // output actual style information written = target.Write(flattenedRuns, flattenedSize); - free(flattenedRuns); - if (written < B_OK) return written; if (written != flattenedSize)