{"action":"closed","issue":{"url":"https://api.github.com/repos/zeromq/pyzmq/issues/793","labels_url":"https://api.github.com/repos/zeromq/pyzmq/issues/793/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/pyzmq/issues/793/comments","events_url":"https://api.github.com/repos/zeromq/pyzmq/issues/793/events","html_url":"https://github.com/zeromq/pyzmq/issues/793","id":127588815,"number":793,"title":"memory leak in failed send/recv","user":{"login":"yshysh","id":6756230,"avatar_url":"https://avatars.githubusercontent.com/u/6756230?v=3","gravatar_id":"","url":"https://api.github.com/users/yshysh","html_url":"https://github.com/yshysh","followers_url":"https://api.github.com/users/yshysh/followers","following_url":"https://api.github.com/users/yshysh/following{/other_user}","gists_url":"https://api.github.com/users/yshysh/gists{/gist_id}","starred_url":"https://api.github.com/users/yshysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yshysh/subscriptions","organizations_url":"https://api.github.com/users/yshysh/orgs","repos_url":"https://api.github.com/users/yshysh/repos","events_url":"https://api.github.com/users/yshysh/events{/privacy}","received_events_url":"https://api.github.com/users/yshysh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-20T02:16:05Z","updated_at":"2016-01-21T11:41:02Z","closed_at":"2016-01-21T11:41:02Z","body":"![image](https://cloud.githubusercontent.com/assets/6756230/12438022/10250a34-bf5e-11e5-8cd3-a1761ef502e0.png)\r\nwhen we try to use Socket.send method, we found that if the flags is NOBLOCK, memory leak happens. After reading the socket.pyx, we found the reason of memory leak as shown in the picture. when the function \"zmq_msg_send(&data, handle, flags)\" failed, the memory alloc by \"zmq_msg_init_size\" is not freed."}}