Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lME2f-0001D6-Li for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Mar 2021 18:03:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lME2d-0007ML-Lc for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Mar 2021 18:03:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lME2d-0007ME-Fo for pgsql-bugs@lists.postgresql.org; Tue, 16 Mar 2021 18:03:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lME2b-0003rS-7n for pgsql-bugs@lists.postgresql.org; Tue, 16 Mar 2021 18:03:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12GI3Yr13376869; Tue, 16 Mar 2021 14:03:34 -0400 From: Tom Lane To: Andres Freund cc: Jelte Fennema , Michael Paquier , duspensky@ya.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16160: Minor memory leak in case of starting postgres server with SSL encryption In-reply-to: <20210316180109.ko6vqm7n4iovzryf@alap3.anarazel.de> References: <16160-18367e56e9a28264@postgresql.org> <20191213063915.GE1942@paquier.xyz> <20191214092456.GB70616@paquier.xyz> <3255514.1615912277@sss.pgh.pa.us> <20210316180109.ko6vqm7n4iovzryf@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 16 Mar 2021 11:01:09 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3376867.1615917814.1@sss.pgh.pa.us> Date: Tue, 16 Mar 2021 14:03:34 -0400 Message-ID: <3376868.1615917814@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2021-03-16 12:31:17 -0400, Tom Lane wrote: >> I'm wondering about that because I see some other stuff in be_tls_init() >> that looks like it might get leaked, notably the root_cert_list read >> from the ssl_ca_file. > Given that we're careful to destroy the "temporary" ssl context in case > of error, perhaps the best way to deal with root_cert_list being freed > in case of error would be to assign it to the context as soon as its > loaded? Yeah, I came to the same conclusion downthread. I'll go see about making that happen. regards, tom lane