diff options
author | unknown <knielsen@ymer.(none)> | 2006-10-25 10:45:11 +0200 |
---|---|---|
committer | unknown <knielsen@ymer.(none)> | 2006-10-25 10:45:11 +0200 |
commit | 7f4b0c6a50f176dbc047c6da45b16a018ff505fd (patch) | |
tree | 9b97c6998c716dcc8d36d128cb22d906cc75e356 /ndb/include | |
parent | e2ea6f70b3e0b1f7e82b384e79fc992557ca8e2d (diff) | |
parent | c6ca641a6ba8b7edbc9f08de8dc46356b50028a6 (diff) | |
download | mariadb-git-7f4b0c6a50f176dbc047c6da45b16a018ff505fd.tar.gz |
Merge ymer.(none):/usr/local/mysql/mysql-4.1-ndb.tmp
into ymer.(none):/usr/local/mysql/mysql-5.0-ndb
ndb/src/common/util/SimpleProperties.cpp:
Auto merged
Diffstat (limited to 'ndb/include')
-rw-r--r-- | ndb/include/util/UtilBuffer.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ndb/include/util/UtilBuffer.hpp b/ndb/include/util/UtilBuffer.hpp index f43fc960a16..ba1f47b93d8 100644 --- a/ndb/include/util/UtilBuffer.hpp +++ b/ndb/include/util/UtilBuffer.hpp @@ -73,11 +73,15 @@ public: } int assign(const void * d, size_t l) { - if (data) free(data); + /* Free the old data only after copying, in case d==data. */ + void *old_data= data; data = NULL; len = 0; alloc_size = 0; - return append(d, l); + int ret= append(d, l); + if (old_data) + free(old_data); + return ret; } void clear() { |