Issue #11051 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED

ruby_2_1 r50575 merged revision(s) 50187,50202.

----------------------------------------
Bug #11051: Addrinfo#marshal_load がメモリーリーク
https://bugs.ruby-lang.org/issues/11051#change-52535

* Author: Masahiro Tomita
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.2p88 (2015-03-25) [x86_64-linux]
* Backport: 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED
----------------------------------------
`Addrinfo#marshal_load` がメモリーリークしているように思います。

~~~diff
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index e13684a..d838898 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -1643,6 +1643,7 @@ addrinfo_mload(VALUE self, VALUE ary)
 
         len = res->ai->ai_addrlen;
         memcpy(&ss, res->ai->ai_addr, res->ai->ai_addrlen);
+        rb_freeaddrinfo(res);
         break;
       }
     }
~~~



-- 
https://bugs.ruby-lang.org/