Fixing two memory leaks

These are 2 memory leaks related to prepared statements
* Resultset (MySQL_ResultSet() not deallocated
* mysql_stmt_free_result() is now correctly called
pull/739/head
Rene Cannao 10 years ago
parent 5f0b68d004
commit 2d541fb275

@ -2713,6 +2713,7 @@ void MySQL_Session::MySQL_Stmt_Result_to_MySQL_wire(MYSQL_STMT *stmt, MySQL_Conn
if (stmt_result) {
MySQL_ResultSet *MyRS=new MySQL_ResultSet(&client_myds->myprot, stmt_result, stmt->mysql, stmt);
bool resultset_completed=MyRS->get_resultset(client_myds->PSarrayOUT);
delete MyRS;
} else {
MYSQL *mysql=stmt->mysql;
// no result set

@ -1337,11 +1337,11 @@ void MySQL_Connection::async_free_result() {
query.stmt_result=NULL;
}
if (query.stmt) {
mysql_stmt_free_result(query.stmt);
}
if (mysql_result) {
mysql_free_result(mysql_result);
mysql_result=NULL;
mysql_stmt_free_result(query.stmt);
}
async_state_machine=ASYNC_IDLE;
if (MyRS) {

Loading…
Cancel
Save