Chromium Code Reviews| Index: net/disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc |
| diff --git a/net/disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc b/net/disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc |
| index 3936358236dd37d787ff9396fd6fc2e218da7b91..a3a4556da8101d178313d11861c02515d81eb047 100644 |
| --- a/net/disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc |
| +++ b/net/disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc |
| @@ -16,8 +16,11 @@ void* MappedFile::Init(const base::FilePath& name, size_t size) { |
| if (init_ || !File::Init(name)) |
| return NULL; |
| - if (!size) |
| + if (!size) { |
| size = GetLength(); |
| + if (!size) |
| + return NULL; |
|
danakj
2016/11/29 01:48:01
0 should be okay again for this CL
|
| + } |
| buffer_ = malloc(size); |
| snapshot_ = malloc(size); |