From 7ec26b03a77bdff5cd5f55b259720961cfea11fc Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Thu, 16 Feb 2017 11:49:13 +0530 Subject: --- sql-common/client.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sql-common/client.c') diff --git a/sql-common/client.c b/sql-common/client.c index cd9b6a71c53..3a6e205d384 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3790,12 +3790,15 @@ static void mysql_close_free(MYSQL *mysql) */ static void mysql_prune_stmt_list(MYSQL *mysql) { - LIST *element= mysql->stmts; LIST *pruned_list= 0; - for (; element; element= element->next) + while(mysql->stmts) { - MYSQL_STMT *stmt= (MYSQL_STMT *) element->data; + LIST *element= mysql->stmts; + MYSQL_STMT *stmt; + + mysql->stmts= list_delete(element, element); + stmt= (MYSQL_STMT *) element->data; if (stmt->state != MYSQL_STMT_INIT_DONE) { stmt->mysql= 0; -- cgit v1.2.1