Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wH9yE-006ujL-2X for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Apr 2026 00:37:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wH9yC-00BU8d-24 for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Apr 2026 00:37:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wH9yC-00BU8V-12 for pgsql-hackers@lists.postgresql.org; Mon, 27 Apr 2026 00:37:04 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wH9yA-00000003Fa9-1FIL for pgsql-hackers@lists.postgresql.org; Mon, 27 Apr 2026 00:37:04 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfout.phl.internal (Postfix) with ESMTP id 38DB6EC00E0; Sun, 26 Apr 2026 20:37:01 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Sun, 26 Apr 2026 20:37:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1777250221; x=1777336621; bh=Ydxw3IJbgZ OGD7Ny7ZgZ/SAo44pr4UfKwjmtdnKIWTw=; b=iomz6jgDwqiJVkckJG3XXuotPP tPCBpUlwpzNd1mjk8gJSrhD4++mfjyZWhah5H/vWTK4aP6cGRkxT1FkQs5s4V8bM mBMJwMjlu09J6ypGiFzcEpyOB0///Eks7/RndC0t8LIbmMa67aU7SRAa+au5GSbw uVVCUSPPDyFSf0JeUq27X/vrEARq6b+OSlYy81cj+d6KwWRuCQwbAp0C9u1M18ul sVNpF09yNvfoQz9Kqyfbv7tDHYivmq9coxXenYZetMfDQrDBbh+NgQIEYfTTOCpi nKWl6n4ot0d6KlTWMxfi9az6i2W3DMYEOiWrNxCdqQPAcqzlcP5m5RZGgEeQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1777250221; x=1777336621; bh=Ydxw3IJbgZOGD7Ny7ZgZ/SAo44pr4UfKwjm tdnKIWTw=; b=jiYdQWzFaBMBwkksK0f7bTGxKsNeiGJxu014yPVRcWjpB6r0EaD KqIuIVNZ/MDGryPMFiW/IXd8vJx/M/LgFEtWYFf7Hc4zi86Ed5I5WIcqq6G7T3+V 7s4MCLXHQcRf6EwjjaT67mE13opFUtdSdrVr1FZUmY40W+dKaReKUrN+0BdfCL5w Ary889bdDy98Jvs4BwZr7cHrSHQW3clMw/FsprPEG+4m9vwLAh+31JSZxz4tyRs/ gQ66jE1ewn8rrpU6IlEqtADDxqsqSOAMljLBoPIQM/03abu4GrHmHJer2r/VZIg0 XR4qh414hvNeuoaBEMCD2ZjQ7DWaPyyn5/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdejjedviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuf fkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgv rhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpe etleeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvg hlsehprghquhhivghrrdighiiipdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhp ohhuthdprhgtphhtthhopegthhgrrhhshigrmhesghhmrghilhdrtghomhdprhgtphhtth hopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhr gh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Apr 2026 20:36:59 -0400 (EDT) Date: Mon, 27 Apr 2026 09:36:55 +0900 From: Michael Paquier To: DaeMyung Kang Cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Fix memory leak of primary_sysid in walreceiver Message-ID: References: <20260426170219.849330-1-charsyam@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QaR6R2sIeSlUg6f8" Content-Disposition: inline In-Reply-To: <20260426170219.849330-1-charsyam@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --QaR6R2sIeSlUg6f8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 27, 2026 at 02:01:30AM +0900, DaeMyung Kang wrote: > The attached patch adds a pfree(primary_sysid) right after the > comparison. My first impression was that it does not matter because I was under the impression that this code path is only reached once, but that's not the case: a WAL receiver could stay around waiting for instructions before retrying a connection. I doubt that this is worth bothering for in the back branches, as it just means a small leak each time we switch to a new TLI repeatedly, something that would matter mostly for a cascading standby where we don't want to change the connection point (a SIGHUP'd primary_conninto enforces a WAL receiver shutdown). Let's clean up on HEAD, though. -- Michael --QaR6R2sIeSlUg6f8 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnur6cACgkQnvQgOdby QH15zA//Vb3QgL+nrZ4ZHxcaQSkxXbYYCQGQP14wk0/XPjNVQq6QHUC+o87jb2Xe aG+AW+He9M6h0zJxe8k1v8Dfx3kL7HukC8y76nP2ukBve9m3yDaLi5RzBhjtAW+8 eV7BPgph1W1yXisiex719WJwKk6j5/pA9gMrmBQCnje5Hn1MVZViFmsJ9PSeLN47 jiSZE3K5esAiGzu3eelrlbaiEn9/cILSvbrk4FdyGoe2MwkNIcgh5oNeHY3aoRxE 5gTmKEFspRg0+v4SGJz+lcrrj074ifIzrStKPTiyrQdf5+Skr4Tl60DemML8pOFZ iI1DwsYmeGEkKg3fdTLk2RWA+G2Rzd28za42GAnkV4lJSg5/4cEuCU6WzaD2xaxn wC9oT757Xo0NrZMrGPSe0cv4ZExkl/feQQSIcJGar72BnAy0vmcB+/DWUmsjBwFc 6pjMbzcyf3XVGKCPFvz7Vz9+kbyZVrQPxZC5s4WXwb3EnuODqSjCLPBpczQi5JRA UvKOdYeCXeC+N/9fFbyDjb1v06hrb54jiziccKFx8n3eBojbwFZvI7CSNXnPAQoK ju3HAObgUsYqJCuQITQVLATE2wNBYA6Eu0OyTCM0hJZxs+vTMfMvmT3YJoEoELG9 7bIYslxMboAxYcNUgFheqDSjwjNw/aeKoagGh/c5j2tZKhtRwQI= =Blpp -----END PGP SIGNATURE----- --QaR6R2sIeSlUg6f8--