diff options
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r-- | ext/socket/ancdata.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 0a94149b08..ef6a870fa2 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -1135,7 +1135,7 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock) struct msghdr mh; struct iovec iov; #if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) - volatile VALUE controls_str = 0; + VALUE controls_str = 0; VALUE *controls_ptr = NULL; int family; #endif @@ -1291,6 +1291,9 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock) rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "sendmsg(2) would block"); rb_sys_fail("sendmsg(2)"); } +#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) + RB_GC_GUARD(controls_str); +#endif return SSIZET2NUM(ss); } |