Index: base/memory/shared_memory_win.cc |
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc |
index 20659ab97af7b1d3220c077d69435146db226f3e..7e0cf0bf23e67f0d13d22e56e0924cecda7456ce 100644 |
--- a/base/memory/shared_memory_win.cc |
+++ b/base/memory/shared_memory_win.cc |
@@ -144,7 +144,8 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) { |
rand_values[2], rand_values[3]); |
} |
mapped_file_ = CreateFileMapping(INVALID_HANDLE_VALUE, &sa, |
- PAGE_READWRITE, 0, static_cast<DWORD>(rounded_size), name_.c_str()); |
+ PAGE_READWRITE, 0, static_cast<DWORD>(rounded_size), |
+ name_.empty() ? nullptr : name_.c_str()); |
if (!mapped_file_) |
return false; |