message: [trt allocator]
  return nullptr when allocation fails
  abort free() when receiving nullptr as input
diff: @@ -42,11 +42,13 @@ void* TRTDeviceAllocator::allocate(uint64_t size, uint64_t alignment,
  // See issue #20856
  alignment = 512;
  assert((alignment & (alignment - 1)) == 0); // zero or a power of 2.
  - void* mem = allocator_->AllocateRaw(alignment, size + alignment);
  - CHECK(mem);
  + size_t total_size = size + alignment;
  + void* mem = allocator_->AllocateRaw(alignment, total_size);
  + if (!mem) {
  + return nullptr;
  + }
  void* alloc_mem = mem;
  - uint64_t total_size = size + alignment;
  CHECK(std::align(alignment, size, mem, total_size));
  if (mem != alloc_mem) {
  CHECK(mem_map_.insert({mem, alloc_mem}).second);
  @@ -64,7 +66,7 @@ TRTDeviceAllocator::TRTDeviceAllocator(tensorflow::Allocator* allocator)
  void TRTDeviceAllocator::free(void* memory) {
  VLOG(2) << "Deallocating @ " << memory;
  // allocated memory adjusted for alignment, restore the original pointer
  -
  + if (memory) {
  auto alloc_mem = mem_map_.find(memory);
  if (alloc_mem != mem_map_.end()) {
  memory = alloc_mem->second;
  @@ -72,6 +74,7 @@ void TRTDeviceAllocator::free(void* memory) {
  }
  allocator_->DeallocateRaw(memory);
  }
  +}
  } // namespace tensorrt
  } // namespace tensorflow
  