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

[esl] 1227669 Resource leak #2755

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libs/esl/src/esl.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,8 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
}

memcpy(&handle->sockaddr, result->ai_addr, result->ai_addrlen);
freeaddrinfo(result);

switch(handle->sockaddr.ss_family) {
case AF_INET:
sockaddr_in = (struct sockaddr_in*)&(handle->sockaddr);
Expand All @@ -1005,7 +1007,6 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
strncpy(handle->err, "Host resolves to unsupported address family", sizeof(handle->err));
goto fail;
}
freeaddrinfo(result);

handle->sock = socket(handle->sockaddr.ss_family, SOCK_STREAM, IPPROTO_TCP);

Expand Down