]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Free connection handle ctx on error
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 15 Jun 2015 20:50:35 +0000 (16:50 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 15 Jun 2015 20:51:04 +0000 (16:51 -0400)
src/main/connection.c

index ed6bc61ecf9f3523365551629103da01a654424a..e014e37344420daae4fca2df2d5dd860f277a5e7 100644 (file)
@@ -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);