Merge pull request #3106 from danderson/asan-fixes

Asan fixes

Reviewed-by: Loic Dachary <ldachary@redhat.com>
This commit is contained in:
Loic Dachary 2014-12-08 08:33:26 +01:00
commit bc2b9f6bf5
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ void bloom_filter::decode(bufferlist::iterator& p)
salt_.clear();
generate_unique_salt();
table_size_ = t.length();
delete bit_table_;
delete[] bit_table_;
if (table_size_) {
bit_table_ = new cell_type[table_size_];
t.copy(0, table_size_, (char *)bit_table_);

View File

@ -328,7 +328,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
~raw_pipe() {
if (data)
delete data;
free(data);
close_pipe(pipefds);
dec_total_alloc(len);
bdout << "raw_pipe " << this << " free " << (void *)data << " "

View File

@ -83,7 +83,7 @@ TEST(chain_xattr, get_and_set) {
const string x(LARGE_BLOCK_LEN, 'X');
{
char y[CHAIN_XATTR_MAX_NAME_LEN];
char y[CHAIN_XATTR_MAX_BLOCK_LEN];
ASSERT_EQ(LARGE_BLOCK_LEN, chain_setxattr(file, name.c_str(), x.c_str(), LARGE_BLOCK_LEN));
ASSERT_EQ(CHAIN_XATTR_MAX_BLOCK_LEN, chain_setxattr(file, name.c_str(), x.c_str(), CHAIN_XATTR_MAX_BLOCK_LEN));
ASSERT_EQ(CHAIN_XATTR_MAX_BLOCK_LEN, chain_getxattr(file, name.c_str(), 0, 0));