Skip to content

Commit a290f25

Browse files
committed
CONPY-318: Fixed segmentation fault
Before clearing results of a cursor we need to check if the connection was closed before.
1 parent 391cfff commit a290f25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mariadb/mariadb_cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ PyObject *MrdbCursor_clear_result(MrdbCursor *self)
426426
mysql_free_result(self->result);
427427
}
428428
/* clear pending result sets */
429-
if (self->connection->mysql)
429+
if (self->connection && self->connection->mysql)
430430
{
431431
do {
432432
MYSQL_RES *res;

0 commit comments

Comments
 (0)