Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utp_socket memory can be leaked #113

Open
anacrolix opened this issue Jun 13, 2018 · 0 comments
Open

utp_socket memory can be leaked #113

anacrolix opened this issue Jun 13, 2018 · 0 comments

Comments

@anacrolix
Copy link
Contributor

If utp_create_socket is called, and then utp_connect is not called, there's no way to reclaim the utp_socket memory. If the parent utp_context is destroyed, the memory for the unconnected utp_socket is not reclaimed, and it's no longer possible to call utp_connect.

sock = utp_create_socket(ctx)
utp_destroy(ctx)
# segfaults, no way to reclaim sock memory
utp_connect(sock)

Here's another sequence:

sock = utp_create_socket(ctx)
utp_destroy(ctx)
# asserts
utp_close(sock)

I think utp_connect should not segfault if the parent utp_context is destroyed, and utp_close should probably delete the utp_socket if it's uninitialized.

anacrolix added a commit to anacrolix/go-libutp that referenced this issue Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant