summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2017-02-16 11:49:13 +0530
committerNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2017-02-16 11:50:09 +0530
commit7ec26b03a77bdff5cd5f55b259720961cfea11fc (patch)
tree9e3734dba6aec9d4d75b3cb7dbf36d93468e71dd /sql-common
parent6fce90e52426b3d6b9ad3800c2a9a1100e79a7ab (diff)
downloadmariadb-git-7ec26b03a77bdff5cd5f55b259720961cfea11fc.tar.gz
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c11
1 files changed, 7 insertions, 4 deletions
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;