Skip to content

Commit

Permalink
Check the write value after memory allocation #1392
Browse files Browse the repository at this point in the history
  • Loading branch information
icraggs committed Oct 1, 2023
1 parent 9613cf4 commit 77d0623
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ int Socket_addSocket(SOCKET newSd)
mod_s.fds_write = realloc(mod_s.fds_write, mod_s.nfds * sizeof(mod_s.fds_write[0]));
else
mod_s.fds_write = malloc(mod_s.nfds * sizeof(mod_s.fds_write[0]));
if (!mod_s.fds_read)
if (!mod_s.fds_write)
{
rc = PAHO_MEMORY_ERROR;
goto exit;
Expand Down

0 comments on commit 77d0623

Please sign in to comment.