diff options
author | dalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-27 00:45:27 +0000 |
---|---|---|
committer | dalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-27 00:45:27 +0000 |
commit | 45a053e5b0627abb6310074e21cc6b2119f3f459 (patch) | |
tree | 00cfae8a7271ef00d92b5f8fc615ab4942a8eaa6 /base/allocator/win_allocator.cc | |
parent | 406277ef31520a6f3c1e6debd77ea136069573ab (diff) | |
download | chromium_src-45a053e5b0627abb6310074e21cc6b2119f3f459.zip chromium_src-45a053e5b0627abb6310074e21cc6b2119f3f459.tar.gz chromium_src-45a053e5b0627abb6310074e21cc6b2119f3f459.tar.bz2 |
Handle NULL ptr calls to free() with the WIN allocator.
_aligned_free() may be called with NULL and should simply do nothing:
http://msdn.microsoft.com/en-us/library/17b5h8td.aspx
BUG=153744
TEST=Things don't crash.
Review URL: https://codereview.chromium.org/11305013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164463 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/allocator/win_allocator.cc')
-rw-r--r-- | base/allocator/win_allocator.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/base/allocator/win_allocator.cc b/base/allocator/win_allocator.cc index 4b979a0..899b867 100644 --- a/base/allocator/win_allocator.cc +++ b/base/allocator/win_allocator.cc @@ -66,7 +66,8 @@ void* win_heap_memalign(size_t alignment, size_t size) { } void win_heap_memalign_free(void* ptr) { - win_heap_free(static_cast<void**>(ptr)[-1]); + if (ptr) + win_heap_free(static_cast<void**>(ptr)[-1]); } } // extern "C" |