mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/bug13163/my50-bug13163
This commit is contained in:
commit
8215469ba8
1 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,8 @@ struct vector_base {
|
|||
vector_base() : start_(0), finish_(0), end_of_storage_(0) {}
|
||||
vector_base(size_t n)
|
||||
{
|
||||
start_ = static_cast<T*>(malloc(n * sizeof(T)));
|
||||
// Don't allow malloc(0), if n is 0 use 1
|
||||
start_ = static_cast<T*>(malloc((n ? n : 1) * sizeof(T)));
|
||||
if (!start_) abort();
|
||||
finish_ = start_;
|
||||
end_of_storage_ = start_ + n;
|
||||
|
|
Loading…
Reference in a new issue