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 1wCZwV-0027tK-1m for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 09:20:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCZwR-00B069-2V for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 09:20:20 +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 1wCZwR-00B060-1b for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 09:20:20 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wCZwQ-00000000zsa-1BcT for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 09:20:19 +0000 Received: from [10.0.2.15] (unknown [130.41.208.1]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4fvzJd0nmPzyRs; Tue, 14 Apr 2026 12:20:17 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1776158417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iuJR10gwKA94wb16VQP6VWQrNSQf4pilxtAEZM4RElI=; b=BTqBD46QKg+5h0uOWx6kXDdkyujvcYsv8TT4R0Nb36BYKjOocPD8tFxgzx0FrLfo/M/NAx FdnveewMFKmmyggOswv9HaiXaudYlKS0zl6p98TpYOeBjfv237O+hg8UeN+clqNdwQrhbB GrVxUa+fPMCjReWmncMJC+9Hq9hkg2w= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1776158417; b=oLMaDslLWv3hbpR3zGsdjHa0Ju6M3kby0cw0OvwjdRs6y0CYf/MbKJUWPKHUGH9wZHJqF/ BM+bG10pDe47CqzEis/mZyomq/kaY8Gia0SKUAQVotZNF+1qmhVnAdzTXcW48p/zaTsITM OiRFxTUO6EfBAKxFN/P/owvL9qcOBhs= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1776158417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iuJR10gwKA94wb16VQP6VWQrNSQf4pilxtAEZM4RElI=; b=ueFGHmVr992+wVvM3c+/H4exYXkN63UNFlxYSjMcBlo+JhdS2XBBh1w6xD2JkLwWQ81nQa Fx+6R+/4JxJ/6PEaOS5ste0TWWaaoywP0RaosZe+8Dn9toR4DlEukSXzXDXAD9lIbED9DY P3P9GY+4kr0Ffi9GdXFScHMqedn81Y4= Message-ID: <891df2c6-9f41-4b5e-80c7-fe489decf1ad@iki.fi> Date: Tue, 14 Apr 2026 12:20:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fix missing pfree(flags.data) in overexplain_debug To: Lakshmi N , pgsql-hackers@lists.postgresql.org References: Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 13/04/2026 23:33, Lakshmi N wrote: > Hi hackers, > > attached a small patch to fix missing  pfree(flags.data) in > overexplain_debug. These leaks are to a relatively short-lived memory context. We don't need to meticulously pfree() those, they will go away with the memory context. There are also numerous psprintf() calls in the function and in the subroutines which are not pfreed, for example. We're not totally consistent, as there are pfree() calls in some of the subroutines. I don't know if there's some grand plan on when to pfree() and when not to bother, but this one pfree() won't move the needle much in any case. - Heikki