From 54184da72c3a497be45cbd94a502372bd9da5a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Thu, 4 Feb 2016 20:39:50 +0100 Subject: [PATCH] Fix a bug : bad size for sockets malloc --- src/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index cb8ff55..059806e 100644 --- a/src/server.c +++ b/src/server.c @@ -279,7 +279,7 @@ static inline thread_ctx_t* create_thread_ctx(struct gengetopt_args_info* params if (params->verbose_flag) syslog(LOG_DEBUG, "Create a new thread %p", thread_ctx); - thread_ctx->sockets = malloc(sizeof(thread_ctx->sockets)*params->sockets_per_thread_arg); + thread_ctx->sockets = malloc(sizeof(*thread_ctx->sockets)*params->sockets_per_thread_arg); thread_ctx->nb_cur_sockets = 0; thread_ctx->nb_available_sockets = params->sockets_per_thread_arg; thread_ctx->max_timeout = params->sockets_timeout_arg;