mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
@ -2051,7 +2051,8 @@ print_table_data(MYSQL_RES *result)
|
|||||||
separator.fill(separator.length()+length+2,'-');
|
separator.fill(separator.length()+length+2,'-');
|
||||||
separator.append('+');
|
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)
|
if (column_names)
|
||||||
{
|
{
|
||||||
mysql_field_seek(result,0);
|
mysql_field_seek(result,0);
|
||||||
@ -2064,7 +2065,7 @@ print_table_data(MYSQL_RES *result)
|
|||||||
num_flag[off]= IS_NUM(field->type);
|
num_flag[off]= IS_NUM(field->type);
|
||||||
}
|
}
|
||||||
(void) tee_fputs("\n", PAGER);
|
(void) tee_fputs("\n", PAGER);
|
||||||
tee_puts(separator.c_ptr(), PAGER);
|
tee_puts((char*) separator.ptr(), PAGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((cur= mysql_fetch_row(result)))
|
while ((cur= mysql_fetch_row(result)))
|
||||||
@ -2093,7 +2094,7 @@ print_table_data(MYSQL_RES *result)
|
|||||||
}
|
}
|
||||||
(void) tee_fputs("\n", PAGER);
|
(void) tee_fputs("\n", PAGER);
|
||||||
}
|
}
|
||||||
tee_puts(separator.c_ptr(), PAGER);
|
tee_puts((char*) separator.ptr(), PAGER);
|
||||||
my_afree((gptr) num_flag);
|
my_afree((gptr) num_flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2522,7 +2522,7 @@ bool get_key_map_from_key_list(key_map *map, TABLE *table,
|
|||||||
if ((pos= find_type(&table->keynames, name->ptr(), name->length(), 1)) <=
|
if ((pos= find_type(&table->keynames, name->ptr(), name->length(), 1)) <=
|
||||||
0)
|
0)
|
||||||
{
|
{
|
||||||
my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr_safe(),
|
my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr(),
|
||||||
table->real_name);
|
table->real_name);
|
||||||
map->set_all();
|
map->set_all();
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user