summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index 1a22d34c50..442bf52e40 100644
--- a/io.c
+++ b/io.c
@@ -3001,6 +3001,7 @@ io_write_nonblock(VALUE io, VALUE str, VALUE ex)
rb_io_set_nonblock(fptr);
n = write(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
+ RB_GC_GUARD(str);
if (n < 0) {
int e = errno;