Skip to content

resource leak in socket creation? #5

@helium3a

Description

@helium3a

For the createSocket() in common/socket_utils.h, the for loop in the code is iterating over the linked list of addrinfo structures returned by getaddrinfo(). In each iteration of the loop, a new socket is created and the socket_fd is overwritten. If the loop iterates more than once, the previous socket file descriptors will be lost and the sockets will not be closed, which can lead to resource leaks.

I don't know if I am missing something and I would appreciate if anyone can help me with this. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions