loolwsd/ChildSession.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 2df8d928dcaceae59e8b6ce0256b319b70d1933d Author: Henry Castro <hcas...@collabora.com> Date: Tue May 31 10:12:03 2016 -0400 loolwsd: remove unique_ptr to call std:free It is recommended that if you allocate with malloc() it should be deallocated with free() diff --git a/loolwsd/ChildSession.cpp b/loolwsd/ChildSession.cpp index e102405..0f07e73 100644 --- a/loolwsd/ChildSession.cpp +++ b/loolwsd/ChildSession.cpp @@ -653,16 +653,16 @@ bool ChildSession::sendFontRendering(const char* /*buffer*/, int /*length*/, Str Timestamp timestamp; int width, height; unsigned char* ptrFont = _loKitDocument->renderFont(decodedFont.c_str(), &width, &height); - std::unique_ptr<unsigned char[]> pixmap(ptrFont); - std::free(ptrFont); Log::trace("renderFont [" + font + "] rendered in " + std::to_string(timestamp.elapsed()/1000.) + "ms"); - if (!pixmap || - !png::encodeBufferToPNG(pixmap.get(), width, height, output, LOK_TILEMODE_RGBA)) + if (!ptrFont || + !png::encodeBufferToPNG(ptrFont, width, height, output, LOK_TILEMODE_RGBA)) { + std::free(ptrFont); return sendTextFrame("error: cmd=renderfont kind=failure"); } + std::free(ptrFont); return sendBinaryFrame(output.data(), output.size()); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits