Skip to content

Commit 48172b5

Browse files
authored
Don't call mysql_close if mysql_init wasn't called. (#1111)
1 parent 1b15d78 commit 48172b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mysql2/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static VALUE invalidate_fd(int clientfd)
269269
static void *nogvl_close(void *ptr) {
270270
mysql_client_wrapper *wrapper = ptr;
271271

272-
if (!wrapper->closed) {
272+
if (wrapper->initialized && !wrapper->closed) {
273273
mysql_close(wrapper->client);
274274
wrapper->closed = 1;
275275
wrapper->reconnect_enabled = 0;

0 commit comments

Comments
 (0)