{"action":"opened","issue":{"url":"https://api.github.com/repos/sahlberg/libnfs/issues/199","repository_url":"https://api.github.com/repos/sahlberg/libnfs","labels_url":"https://api.github.com/repos/sahlberg/libnfs/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/sahlberg/libnfs/issues/199/comments","events_url":"https://api.github.com/repos/sahlberg/libnfs/issues/199/events","html_url":"https://github.com/sahlberg/libnfs/issues/199","id":227244146,"number":199,"title":"Leak in rpc_service()","user":{"login":"earlchew","id":6503012,"avatar_url":"https://avatars1.githubusercontent.com/u/6503012?v=3","gravatar_id":"","url":"https://api.github.com/users/earlchew","html_url":"https://github.com/earlchew","followers_url":"https://api.github.com/users/earlchew/followers","following_url":"https://api.github.com/users/earlchew/following{/other_user}","gists_url":"https://api.github.com/users/earlchew/gists{/gist_id}","starred_url":"https://api.github.com/users/earlchew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earlchew/subscriptions","organizations_url":"https://api.github.com/users/earlchew/orgs","repos_url":"https://api.github.com/users/earlchew/repos","events_url":"https://api.github.com/users/earlchew/events{/privacy}","received_events_url":"https://api.github.com/users/earlchew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-09T04:05:24Z","updated_at":"2017-05-09T04:05:24Z","closed_at":null,"body":"Using libnfs-1.11.0, I see:\r\n\r\n```\r\n==21843== 4 bytes in 1 blocks are definitely lost in loss record 4 of 1,534\r\n==21843==    at 0x4C2CC4B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==21843==    by 0x4C2CF07: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==21843==    by 0x917136E: rpc_service (socket.c:265)\r\n==21843==    by 0x916DAEA: wait_for_nfs_reply.isra.5 (libnfs-sync.c:167)\r\n==21843==    by 0x916DD13: nfs_mount (libnfs-sync.c:207)\r\n==21843==    by 0x8F4193C: ??? (in /usr/lib/python2.7/dist-packages/libnfs/_libnfs.so)\r\n==21843==    by 0x49D189: call_function.9501 (ceval.c:4025)\r\n==21843==    by 0x48BDDB: PyEval_EvalFrameEx.constprop.14 (ceval.c:2669)\r\n==21843==    by 0x49CBE9: PyEval_EvalCodeEx (ceval.c:3257)\r\n==21843==    by 0x49D3F2: call_function.9501 (ceval.c:4121)\r\n==21843==    by 0x48BDDB: PyEval_EvalFrameEx.constprop.14 (ceval.c:2669)\r\n==21843==    by 0x49C617: PyEval_EvalCodeEx (ceval.c:3257)\r\n```\r\n\r\n```\r\n        if (rpc->insize < pdu_size) {\r\n                rpc->inbuf = realloc(rpc->inbuf, pdu_size);\r\n                if (rpc->inbuf == NULL) {\r\n                        rpc_set_error(rpc, \"Failed to allocate buffer of %d bytes for pdu, errno:%d. Closing socket.\", pdu_size, errno);\r\n                        return -1;\r\n                }\r\n                rpc->insize = pdu_size;\r\n        }\r\n```\r\n\r\nThere doesn't seem to be any reference to ``inbuf`` in ```rpc_destroy_context()```."}}
{"actor":{"display_login":"earlchew"}}