From e3f4f02b64f6b5197fb4fac46811930f40fdc5d9 Mon Sep 17 00:00:00 2001 From: "holyfoot/hf@mysql.com/hfmain.(none)" <> 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 | 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; } }