From 925d4fb92107c0794060bd8856958c4d13d83e4f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Jan 2007 11:48:31 +0400 Subject: [PATCH] bug #25492 (Invalid deallocation in mysql_stmt_fetch) Operating with the prepared statements we don't alloc MYSQL_DATA structure, but use MYSQL_STMT's field instead (to increase performance by reducing malloc calls). So we shouldn't free this structure as we did before. libmysqld/lib_sql.cc: we only should free data->alloc here, as the 'data' is a member of STMT structure --- libmysqld/lib_sql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index fe4ac5ba676..3a8bc189e7f 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -269,7 +269,7 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row) *row= NULL; if (data) { - free_rows(data); + free_root(&data->alloc,MYF(0)); ((THD*)mysql->thd)->data= NULL; } }