summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfedittext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfedittext.cpp')
-rw-r--r--fpdfsdk/fpdfedittext.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdfedittext.cpp
index 54388ef701..c2f2df9778 100644
--- a/fpdfsdk/fpdfedittext.cpp
+++ b/fpdfsdk/fpdfedittext.cpp
@@ -388,11 +388,11 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(FPDF_DOCUMENT document,
if (!pFont)
return nullptr;
- CPDF_TextObject* pTextObj = new CPDF_TextObject;
+ auto pTextObj = pdfium::MakeUnique<CPDF_TextObject>();
pTextObj->m_TextState.SetFont(pFont);
pTextObj->m_TextState.SetFontSize(font_size);
pTextObj->DefaultStates();
- return pTextObj;
+ return pTextObj.release(); // Caller takes ownership.
}
DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetText(FPDF_PAGEOBJECT text_object,