From ec76aec16e3b7784f23773d00460bd09af39d401 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Fri, 9 Jan 2026 20:38:05 +0900 Subject: [PATCH] Fix memory leak in scram authentication. Per Coverity (CID 1395030) Backpatch-through: v4.3 --- src/auth/pool_auth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/auth/pool_auth.c b/src/auth/pool_auth.c index 8c17db4a7..7b5470ebe 100644 --- a/src/auth/pool_auth.c +++ b/src/auth/pool_auth.c @@ -3,7 +3,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2025 PgPool Global Development Group + * Copyright (c) 2003-2026 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -1927,6 +1927,8 @@ do_SCRAM(POOL_CONNECTION *frontend, POOL_CONNECTION *backend, int protoMajor, in * The request contains the name (as assigned by IANA) of the * authentication mechanism. */ + if (sasl_state) + pg_fe_scram_free(sasl_state); sasl_state = pg_SASL_init(backend, payload, payload_len, username, storedPassword); if (!sasl_state) { -- 2.39.5