summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-05-16 20:16:46 +0300
committerunknown <monty@mysql.com>2005-05-16 20:16:46 +0300
commitf80fa96d1c1eb867d65598fd8ad1e3044fb7362a (patch)
treee28ae786c75842a39879f61f512e4a0746277a51 /client/mysql.cc
parent259699b4eb1738ef0ac58b1bb1f7e248523f7ca1 (diff)
downloadmariadb-git-f80fa96d1c1eb867d65598fd8ad1e3044fb7362a.tar.gz
Fix memory leak
client/mysql.cc: Remove usage of c_ptr_safe() as this causes a linkage problem when compiling MySQL without inline functions sql/sql_base.cc: Don't use c_ptr_safe() on this string as this causes a realloc and the String object (allocated by sql_yacc.yy) is never freed
Diffstat (limited to 'client/mysql.cc')
-rw-r--r--client/mysql.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 6a76a1fbd1b..a3262c818f3 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2051,7 +2051,8 @@ print_table_data(MYSQL_RES *result)
separator.fill(separator.length()+length+2,'-');
separator.append('+');
}
- tee_puts(separator.c_ptr_safe(), PAGER);
+ separator.append('\0'); // End marker for \0
+ tee_puts((char*) separator.ptr(), PAGER);
if (column_names)
{
mysql_field_seek(result,0);
@@ -2064,7 +2065,7 @@ print_table_data(MYSQL_RES *result)
num_flag[off]= IS_NUM(field->type);
}
(void) tee_fputs("\n", PAGER);
- tee_puts(separator.c_ptr(), PAGER);
+ tee_puts((char*) separator.ptr(), PAGER);
}
while ((cur= mysql_fetch_row(result)))
@@ -2093,7 +2094,7 @@ print_table_data(MYSQL_RES *result)
}
(void) tee_fputs("\n", PAGER);
}
- tee_puts(separator.c_ptr(), PAGER);
+ tee_puts((char*) separator.ptr(), PAGER);
my_afree((gptr) num_flag);
}