Skip to content

Commit

Permalink
Plug small memory leak in socket resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
HParker committed Jan 4, 2024
1 parent 46af52f commit 8d22873
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ static int _cb_raw_close(trilogy_sock_t *_sock)
if (sock->fd != -1) {
rc = close(sock->fd);
}

if (sock->addr) {
if (sock->base.opts.path != NULL) {
free(sock->addr->ai_addr);
}
freeaddrinfo(sock->addr);
}

Expand Down

0 comments on commit 8d22873

Please sign in to comment.