summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp
index f6b168c89d..d0a6127bbc 100644
--- a/xfa/fgas/font/cfgas_fontmgr.cpp
+++ b/xfa/fgas/font/cfgas_fontmgr.cpp
@@ -626,10 +626,11 @@ RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream(
if (dwFileSize == 0)
return nullptr;
- uint8_t* pBuffer = FX_Alloc(uint8_t, dwFileSize + 1);
- dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, pBuffer, dwFileSize);
-
- return pdfium::MakeRetain<CFX_MemoryStream>(pBuffer, dwFileSize);
+ std::unique_ptr<uint8_t, FxFreeDeleter> pBuffer(
+ FX_Alloc(uint8_t, dwFileSize + 1));
+ dwFileSize =
+ pSystemFontInfo->GetFontData(hFont, 0, pBuffer.get(), dwFileSize);
+ return pdfium::MakeRetain<CFX_MemoryStream>(std::move(pBuffer), dwFileSize);
}
RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream(