summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsvensson@neptunus.(none) <>2005-09-27 16:36:14 +0200
committermsvensson@neptunus.(none) <>2005-09-27 16:36:14 +0200
commit39dde505fd1e1261395fa6c949ca56628e60f273 (patch)
treee56bedb66dbc40ce86734bb914b0e740553ab003
parentfa554264ff1488cb552f37c161b07d2b8c34d8a1 (diff)
parente0b4e273f613d360a813e52dd6d221c8d192873e (diff)
downloadmariadb-git-39dde505fd1e1261395fa6c949ca56628e60f273.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/bug13163/my50-bug13163
-rw-r--r--extra/yassl/mySTL/vector.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/extra/yassl/mySTL/vector.hpp b/extra/yassl/mySTL/vector.hpp
index e7f63c37c7c..9eab91cfda8 100644
--- a/extra/yassl/mySTL/vector.hpp
+++ b/extra/yassl/mySTL/vector.hpp
@@ -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;