From: Alan T. DeKok Date: Sun, 1 Mar 2026 20:04:52 +0000 (-0500) Subject: various bug fixes in pool.c X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b71964a264ca635ccc19450323549341ae1b2ddd;p=thirdparty%2Ffreeradius-server.git various bug fixes in pool.c --- diff --git a/src/lib/server/pool.c b/src/lib/server/pool.c index 105711bf0a7..d8b7f3ec078 100644 --- a/src/lib/server/pool.c +++ b/src/lib/server/pool.c @@ -432,8 +432,7 @@ static fr_pool_connection_t *connection_spawn(fr_pool_t *pool, request_t *reques * Allocate a new top level ctx for the create callback * to hang its memory off of. */ - ctx = talloc_init("connection_ctx"); - if (!ctx) return NULL; + MEM(ctx = talloc_init("connection_ctx")); /* * This may take a long time, which prevents other @@ -445,8 +444,8 @@ static fr_pool_connection_t *connection_spawn(fr_pool_t *pool, request_t *reques if (!conn) { ERROR("Opening connection failed (%" PRIu64 ")", number); - pool->state.last_failed = now; pthread_mutex_lock(&pool->mutex); + pool->state.last_failed = now; pool->pending_window = 1; pool->state.pending--; @@ -478,7 +477,7 @@ static fr_pool_connection_t *connection_spawn(fr_pool_t *pool, request_t *reques return NULL; } - talloc_link_ctx(this, ctx); + MEM(talloc_link_ctx(this, ctx) >= 0); this->created = now; this->connection = conn;