Fixed warnings and one memory loss found by valgrind

The memory loss could happen in Aria with encrypted tables when Aria failed to encrypt a block.
In normal usage this should never happen.
This commit is contained in:
Monty 2016-02-02 19:54:18 +02:00
parent 11c2d3c3e2
commit 55ea26541d
3 changed files with 13 additions and 13 deletions

View File

@ -1277,6 +1277,15 @@
fun:dlopen@@GLIBC_2.2.5
}
{
vasprintf in OpenSuse 12.3
Memcheck:Leak
fun:malloc
fun:vasprintf
fun:asprintf
fun:dlerror
}
{
GitHub codership/galera#308
Memcheck:Leak

View File

@ -6635,17 +6635,6 @@ static void copy_data_file_state(MARIA_STATE_INFO *to,
}
/* Return 1 if block is full of zero's */
static my_bool zero_filled_block(uchar *tmp, uint length)
{
while (length--)
if (*(tmp++) != 0)
return 0;
return 1;
}
/*
Read 'safely' next record while scanning table.
@ -6753,8 +6742,7 @@ read_next_page:
sometimes be found at end of a bitmap when we wrote a big
record last that was moved to the next bitmap.
*/
if (!zero_filled_block(info->scan.page_buff, share->block_size) ||
_ma_check_bitmap_data(info, UNALLOCATED_PAGE, 0,
if (_ma_check_bitmap_data(info, UNALLOCATED_PAGE, 0,
_ma_bitmap_get_page_bits(info,
&share->bitmap,
page)))

View File

@ -416,7 +416,10 @@ static my_bool ma_crypt_index_pre_write_hook(PAGECACHE_IO_HOOK_ARGS *args)
/* 2 - encrypt page */
if (ma_encrypt(share, share->crypt_data,
src + head, dst + head, size, pageno, lsn, &key_version))
{
my_free(crypt_buf);
return 1;
}
/* 3 - copy tail */
memcpy(dst + block_size - tail, src + block_size - tail, tail);
/* 4 - store key version */