From: Arran Cudbard-Bell Date: Mon, 15 Jun 2015 20:50:35 +0000 (-0400) Subject: Free connection handle ctx on error X-Git-Tag: release_3_0_9~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6024c5b41380eaa7cb4d57044a6d9f401eb9816c;p=thirdparty%2Ffreeradius-server.git Free connection handle ctx on error --- diff --git a/src/main/connection.c b/src/main/connection.c index ed6bc61ecf9..e014e373444 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -387,6 +387,9 @@ static fr_connection_t *fr_connection_spawn(fr_connection_pool_t *pool, pool->max_pending = 1; pool->pending--; pthread_mutex_unlock(&pool->mutex); + + talloc_free(ctx); + return NULL; } @@ -399,6 +402,8 @@ static fr_connection_t *fr_connection_spawn(fr_connection_pool_t *pool, this = talloc_zero(pool, fr_connection_t); if (!this) { pthread_mutex_unlock(&pool->mutex); + talloc_free(ctx); + return NULL; } fr_link_talloc_ctx_free(this, ctx);