There is an issue of "File Descriptor(fd) Leak" in "libevent-2.0.22/bufferevent_sock.c".
Platform : Linux
at line:373 fd = socket(sa->sa_family, SOCK_STREAM, 0);
there will a resource leak if ownfd is true (set to 1) and if evutil_socket_connect() return 1
on success case and jump to 'done' label without closing the local 'fd' .
So, I have done a small changes at initialization of 'ownfd' and put 'done :' label before 'ownfd' check . for details please see the patch but I am not sure this patch is fully correct but I think this patch will work in both case 'success' and 'failure' of local 'fd' .
I have made a concentration if local 'fd' is success so need to close before going out of scope.
Please review the patch and give your valuable comments.
Log in to post a comment.