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 1vtnxA-00Eaub-36 for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Feb 2026 14:27:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vtnx9-009yvh-2O for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Feb 2026 14:27:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vtnx9-009yvY-0y for pgsql-hackers@lists.postgresql.org; Sat, 21 Feb 2026 14:27:27 +0000 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vtnx5-00000000WSR-1Dzn for pgsql-hackers@postgresql.org; Sat, 21 Feb 2026 14:27:26 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0599E443AD for ; Sat, 21 Feb 2026 14:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x48.dk; s=gm1; t=1771684036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=owNogfsTEvPmpYJrxn98a7UcNJ2lhYggNxE6hEcVfNA=; b=PRgdZMx7COrG1R3AWVoDzsLYbE6Wg1a0WtxgL6vt89WdoFntfMGpQZT6uVSH4u9FngFGrY +v/Bz21/i5b1nhw5WOGreYExIdAky7aUY0PxW35HxQxjjmBvJC74kGXDA+1+QeVcYumbqM xNAf7cYE6W513gKDhT7B09+kkPn+idstFQFIE8IWSYiLxoMp6YZWQpuxacJ2ST25y79yIh gx4PJNDObQrn9Z0AyXgbySqDw0vQCOcnALPFj4tyJCGZFoIsVWl+PES2z+vS9a2KM21GJf ta7362YC13RLpShrmYJBzBO6bAYWLne389rrsi77bai5vFqDxWqmmAd8ywqsBw== Date: Sat, 21 Feb 2026 15:27:15 +0100 (CET) From: Henrik TJ To: PostgreSQL Hackers Subject: Fix memory leak in postmasterMain Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463761151-855927366-1771684036=:293663" X-GND-Sasl: henrik@0x48.dk X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvfeduieduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkgggtsehmtderredttddvnecuhfhrohhmpefjvghnrhhikhcuvffluceohhgvnhhrihhksedtgiegkedrughkqeenucggtffrrghtthgvrhhnpefgffduleevjeevvddvleduteetvddutdfguddvjeduhfeiteevhfejveefffejtdenucfkphepkeehrddvtdefrddvtdehrddugedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepkeehrddvtdefrddvtdehrddugedupdhhvghlohepthhorhhrvghnthdpmhgrihhlfhhrohhmpehhvghnrhhikhestdiggeekrdgukhdpqhhiugeptdehleelgfeggeefteffpdhmohguvgepshhmthhpohhuthdpnhgspghrtghpthhtohepuddprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463761151-855927366-1771684036=:293663 Content-Type: text/plain; format=flowed; charset=US-ASCII Hi This is fairly inconsequential as memory leaks goes, but if -D is used when starting postgres, the memory allocated by stdrup() will never be freed. Found with valgrind. Technically, this also happens with output_config_variable (-C), but since postmaster prints and exits with that, there isn't much point in fixing it. best regards, Henrik ---1463761151-855927366-1771684036=:293663 Content-Type: text/plain; charset=US-ASCII; name=v1-0001-Fix-userDoption-not-getting-freed-in-postmaster.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=v1-0001-Fix-userDoption-not-getting-freed-in-postmaster.patch RnJvbSA3OGE4OGJhMTBmOGY2YWVhMmI0Y2NmODMxYWI2Nzc1YmFlNjg2MDNj IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogSGVucmlrIFRKIDxo ZW5yaWtAMHg0OC5kaz4NCkRhdGU6IFdlZCwgMTggRmViIDIwMjYgMTU6Mjg6 NTIgKzAxMDANClN1YmplY3Q6IFtQQVRDSF0gRml4IHVzZXJEb3B0aW9uIG5v dCBnZXR0aW5nIGZyZWVkIGluIHBvc3RtYXN0ZXINCg0KLS0tDQogc3JjL2Jh Y2tlbmQvcG9zdG1hc3Rlci9wb3N0bWFzdGVyLmMgfCAyICsrDQogMSBmaWxl IGNoYW5nZWQsIDIgaW5zZXJ0aW9ucygrKQ0KDQpkaWZmIC0tZ2l0IGEvc3Jj L2JhY2tlbmQvcG9zdG1hc3Rlci9wb3N0bWFzdGVyLmMgYi9zcmMvYmFja2Vu ZC9wb3N0bWFzdGVyL3Bvc3RtYXN0ZXIuYw0KaW5kZXggM2ZhYzQ2YzQwMmIu Ljc0ODBjMjhmMDhlIDEwMDY0NA0KLS0tIGEvc3JjL2JhY2tlbmQvcG9zdG1h c3Rlci9wb3N0bWFzdGVyLmMNCisrKyBiL3NyYy9iYWNrZW5kL3Bvc3RtYXN0 ZXIvcG9zdG1hc3Rlci5jDQpAQCAtNzg0LDYgKzc4NCw4IEBAIFBvc3RtYXN0 ZXJNYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQogCSAqLw0KIAlpZiAo IVNlbGVjdENvbmZpZ0ZpbGVzKHVzZXJEb3B0aW9uLCBwcm9nbmFtZSkpDQog CQlFeGl0UG9zdG1hc3RlcigyKTsNCisJaWYgKHVzZXJEb3B0aW9uICE9IE5V TEwpDQorCQlmcmVlKHVzZXJEb3B0aW9uKTsNCiANCiAJaWYgKG91dHB1dF9j b25maWdfdmFyaWFibGUgIT0gTlVMTCkNCiAJew0KLS0gDQoyLjUzLjANCg0K ---1463761151-855927366-1771684036=:293663--