summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-09-22 23:33:18 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-09-22 23:33:18 +0400
commita1f1e77c38147778ac76b3232ca10861cffb3dad (patch)
treeecfed3ad4c93790a5ce2ce97a44a165457c664d1 /sql/item_timefunc.cc
parent6baf9d5a616da0dd0ed6762cfacdf43910ca8ebc (diff)
downloadmariadb-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/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index dff4d20f347..103bd96efd4 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2270,8 +2270,6 @@ void Item_extract::print(String *str, enum_query_type query_type)
void Item_extract::fix_length_and_dec()
{
- value.alloc(32); // alloc buffer
-
maybe_null=1; // If wrong date
switch (int_type) {
case INTERVAL_YEAR: max_length=4; date_value=1; break;
@@ -2314,6 +2312,8 @@ longlong Item_extract::val_int()
}
else
{
+ char buf[40];
+ String value(buf, sizeof(buf), &my_charset_bin);;
String *res= args[0]->val_str(&value);
if (!res || str_to_time_with_warn(res->ptr(), res->length(), &ltime))
{