diff options
author | Googler <noreply@google.com> | 2016-03-23 07:56:54 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-03-23 12:21:05 +0000 |
commit | 8a5f5c7a9174222c13f5546e3c467309e19534d7 (patch) | |
tree | 7cbd1490133c6c277f680a3a0fe81f8cb99b7dbb /third_party/ijar | |
parent | 211e6d1558a1de7f6791799e97f04b98f3f8817c (diff) |
Fix asan error introduced by commit 257337638463d01bcf627c60de42861d775fefec.
One cannot call realloc() on the result of operator new.
--
MOS_MIGRATED_REVID=117906367
Diffstat (limited to 'third_party/ijar')
-rw-r--r-- | third_party/ijar/zip.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/third_party/ijar/zip.cc b/third_party/ijar/zip.cc index 84d2d3ec66..3b3efcf7ee 100644 --- a/third_party/ijar/zip.cc +++ b/third_party/ijar/zip.cc @@ -859,7 +859,8 @@ InputZipFile::InputZipFile(ZipExtractorProcessor *processor, : processor(processor), filename_(filename), input_file_(NULL), bytes_unmapped_(0) { uncompressed_data_allocated_ = INITIAL_BUFFER_SIZE; - uncompressed_data_ = new u1[uncompressed_data_allocated_]; + uncompressed_data_ = + reinterpret_cast<u1*>(malloc(uncompressed_data_allocated_)); errmsg[0] = 0; } @@ -898,7 +899,7 @@ bool InputZipFile::Open() { } InputZipFile::~InputZipFile() { - delete[](uncompressed_data_); + free(uncompressed_data_); if (input_file_ != NULL) { input_file_->Close(); delete input_file_; |