diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-09-22 23:33:18 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-09-22 23:33:18 +0400 |
commit | a1f1e77c38147778ac76b3232ca10861cffb3dad (patch) | |
tree | ecfed3ad4c93790a5ce2ce97a44a165457c664d1 /sql/sql_load.cc | |
parent | 6baf9d5a616da0dd0ed6762cfacdf43910ca8ebc (diff) | |
download | mariadb-git-a1f1e77c38147778ac76b3232ca10861cffb3dad.tar.gz |
Bug #56709: Memory leaks at running the 5.1 test suite
Fixed a number of memory leaks discovered by valgrind.
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r-- | sql/sql_load.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc index f9386206dce..4b68f2a3821 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -1116,6 +1116,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs, MYF(MY_WME))) { my_free((uchar*) buffer,MYF(0)); /* purecov: inspected */ + buffer= NULL; error=1; } else @@ -1142,13 +1143,10 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs, READ_INFO::~READ_INFO() { - if (!error) - { - if (need_end_io_cache) - ::end_io_cache(&cache); - my_free((uchar*) buffer,MYF(0)); - error=1; - } + if (!error && need_end_io_cache) + ::end_io_cache(&cache); + + my_free(buffer, MYF(MY_ALLOW_ZERO_PTR)); } |