Skip to content

Commit d11aeb3

Browse files
committed
Null out the statement result buffers after freeing them
1 parent b211b21 commit d11aeb3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/mysql2/result.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ static void rb_mysql_result_free_result(mysql2_result_wrapper * wrapper) {
107107
xfree(wrapper->error);
108108
xfree(wrapper->length);
109109
}
110+
/* Clue that the next statement execute will need to allocate a new result buffer. */
111+
wrapper->result_buffers = NULL;
110112
}
111113
/* FIXME: this may call flush_use_result, which can hit the socket */
112114
/* For prepared statements, wrapper->result is the result metadata */

0 commit comments

Comments
 (0)