diff options
author | unknown <mkindahl@dl145h.mysql.com> | 2007-08-03 17:12:00 +0200 |
---|---|---|
committer | unknown <mkindahl@dl145h.mysql.com> | 2007-08-03 17:12:00 +0200 |
commit | a04dff19f397148e0ddd28aeff02a3706a4e8e19 (patch) | |
tree | a78e176fca2cdf23574d3ded165cfc748280b734 /sql/rpl_utility.h | |
parent | 6df75c85fdc68afc24fa8dea876062dc174b887e (diff) | |
download | mariadb-git-a04dff19f397148e0ddd28aeff02a3706a4e8e19.tar.gz |
Fixes to eliminate valgrind warnings.
sql/rpl_record.cc:
Factoring out expression and putting it in an auto variable.
sql/rpl_utility.cc:
Removing a check that causes compile warnings.
sql/rpl_utility.h:
Ensuring that there is enough memory for the metadata, to avoid reads
from uninitialized memory. Initializing the memory to keep valgrind
quiet.
Diffstat (limited to 'sql/rpl_utility.h')
-rw-r--r-- | sql/rpl_utility.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 034b6e084af..d08f62363af 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -65,10 +65,14 @@ public: m_field_metadata(0), m_null_bits(0), m_memory(NULL) { m_memory= (uchar *)my_multi_malloc(MYF(MY_WME), - &m_type, size, - &m_field_metadata, size * sizeof(short), - &m_null_bits, (m_size + 7) / 8, - NULL); + &m_type, size, + &m_field_metadata, + size * sizeof(uint16), + &m_null_bits, (size + 7) / 8, + NULL); + + bzero(m_field_metadata, size * sizeof(uint16)); + if (m_type) memcpy(m_type, types, size); else |