From 3e5ef465d294d26829b95e59e945ff4255f96abd Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Thu, 13 Jul 2017 15:26:36 -0400 Subject: Use PartitionAlloc with PartitionAllocReturnNull MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL changes usage of PartitionAlloc in fx_memory to allow null return value for methods used by external C libraries. Change-Id: I8e2b5dcfb37e30370606afb9a71a7a1d3a28c097 Reviewed-on: https://pdfium-review.googlesource.com/7770 Commit-Queue: Nicolás Peña Reviewed-by: Tom Sepez --- core/fxcrt/fx_memory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fxcrt/fx_memory.cpp') diff --git a/core/fxcrt/fx_memory.cpp b/core/fxcrt/fx_memory.cpp index 589a4cf508..6a592a12d2 100644 --- a/core/fxcrt/fx_memory.cpp +++ b/core/fxcrt/fx_memory.cpp @@ -26,8 +26,9 @@ void FXMEM_InitializePartitionAlloc() { // TODO(palmer): Remove the |flags| argument. void* FXMEM_DefaultAlloc(size_t byte_size, int flags) { - return pdfium::base::PartitionAllocGeneric(gGeneralPartitionAllocator.root(), - byte_size, "GeneralPartition"); + return pdfium::base::PartitionAllocGenericFlags( + gGeneralPartitionAllocator.root(), pdfium::base::PartitionAllocReturnNull, + byte_size, "GeneralPartition"); } void* FXMEM_DefaultCalloc(size_t num_elems, size_t byte_size) { -- cgit v1.2.3