From 77d062327d8f167e0166274a81308f438fdda894 Mon Sep 17 00:00:00 2001 From: Ian Craggs Date: Sun, 1 Oct 2023 15:04:42 +0100 Subject: [PATCH] Check the write value after memory allocation #1392 --- src/Socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Socket.c b/src/Socket.c index ef8c51e9..face52cc 100644 --- a/src/Socket.c +++ b/src/Socket.c @@ -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;