[core,peer] check return of setsockopt

This commit is contained in:
Armin Novak 2024-06-05 15:17:07 +02:00
parent 90b4e54d7f
commit b9e434be48
No known key found for this signature in database
GPG Key ID: 2CF4A2D2D3D72105
1 changed files with 8 additions and 1 deletions

View File

@ -1456,7 +1456,10 @@ freerdp_peer* freerdp_peer_new(int sockfd)
option_len = sizeof(option_value);
if (sockfd >= 0)
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*)&option_value, option_len);
{
if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*)&option_value, option_len) < 0)
goto fail;
}
if (client)
{
@ -1487,6 +1490,10 @@ freerdp_peer* freerdp_peer_new(int sockfd)
}
return client;
fail:
freerdp_peer_free(client);
return NULL;
}
void freerdp_peer_free(freerdp_peer* client)