Skip to content
Snippets Groups Projects
Commit 981abc39 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Return an error if calloc() fails allocating pollfd array.

parent b404a77c
No related branches found
No related tags found
No related merge requests found
......@@ -362,6 +362,8 @@ SOCKET DLLCALL xpms_accept(struct xpms_set *xpms_set, union xp_sockaddr * addr,
if(FD_ISSET(xpms_set->socks[i].sock, &read_fs)) {
#else
fds = calloc(xpms_set->sock_count, sizeof(*fds));
if (fds == NULL)
return INVALID_SOCKET;
for (i = 0; i < xpms_set->sock_count; i++) {
if (xpms_set->socks[i].sock == INVALID_SOCKET)
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment