diff options
-rw-r--r-- | client/sql_string.cc | 2 | ||||
-rw-r--r-- | sql/sql_string.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/client/sql_string.cc b/client/sql_string.cc index 4a0f2df927b..010da7eb517 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -761,7 +761,7 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length) { if (from->Alloced_length >= from_length) return from; - if (from->alloced || !to || from == to) + if ((from->alloced && (from->Alloced_length != 0)) || !to || from == to) { (void) from->realloc(from_length); return from; diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 4dbc2d77206..10bd3511cd2 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -796,7 +796,7 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length) { if (from->Alloced_length >= from_length) return from; - if (from->alloced || !to || from == to) + if ((from->alloced && (from->Alloced_length != 0)) || !to || from == to) { (void) from->realloc(from_length); return from; |