diff --git a/ext/mysql2_ext.c b/ext/mysql2_ext.c index 0cf5a55..3852f8b 100644 --- a/ext/mysql2_ext.c +++ b/ext/mysql2_ext.c @@ -464,7 +464,7 @@ static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self) { } if (wrapper->lastRow == wrapper->numberOfRows) { // we don't need the mysql C dataset around anymore, peace it - rb_mysql_result_free(wrapper->result); + rb_mysql_result_free(wrapper); } }