Skip to content

Commit 7ec26b0

Browse files
author
Nisha Gopalakrishnan
committed
1 parent 6fce90e commit 7ec26b0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sql-common/client.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -3790,12 +3790,15 @@ static void mysql_close_free(MYSQL *mysql)
37903790
*/
37913791
static void mysql_prune_stmt_list(MYSQL *mysql)
37923792
{
3793-
LIST *element= mysql->stmts;
37943793
LIST *pruned_list= 0;
37953794

3796-
for (; element; element= element->next)
3795+
while(mysql->stmts)
37973796
{
3798-
MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
3797+
LIST *element= mysql->stmts;
3798+
MYSQL_STMT *stmt;
3799+
3800+
mysql->stmts= list_delete(element, element);
3801+
stmt= (MYSQL_STMT *) element->data;
37993802
if (stmt->state != MYSQL_STMT_INIT_DONE)
38003803
{
38013804
stmt->mysql= 0;

0 commit comments

Comments
 (0)