From a2fbef21e3cb8352b4cd3e390623fcd8e4bf49b9 Mon Sep 17 00:00:00 2001 From: jewelcodes Date: Mon, 9 Sep 2024 17:23:38 -0400 Subject: [PATCH] ipc: bug fix in listen() allocating connection backlog --- src/ipc/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/connection.c b/src/ipc/connection.c index d51421a..e844df1 100644 --- a/src/ipc/connection.c +++ b/src/ipc/connection.c @@ -73,7 +73,7 @@ int listen(Thread *t, int sd, int backlog) { if(backlog > 0) sock->backlogMax = backlog; else sock->backlogMax = SOCKET_DEFAULT_BACKLOG; - sock->backlog = calloc(backlog, sizeof(SocketDescriptor *)); + sock->backlog = calloc(sock->backlogMax, sizeof(SocketDescriptor *)); if(!sock->backlog) { socketRelease(); return -ENOBUFS;