From: Tom Lane <tgl@sss.pgh.pa.us>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: wliang@stu.xidian.edu.cn
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Report a potential bug caused by a improper call to pfree()
Date: Sun, 30 Jan 2022 10:29:27 -0500
Message-ID: <216147.1643556567@sss.pgh.pa.us> (raw)
In-Reply-To: <20220130133624.gmxsaxfvkbg4rz7y@jrouhaud>
References: <662c1e07.2b1.17ea8e13613.Coremail.wliang@stu.xidian.edu.cn>
<20220130133624.gmxsaxfvkbg4rz7y@jrouhaud>
Julien Rouhaud <rjuju123@gmail.com> writes:
> On Sun, Jan 30, 2022 at 10:47:18AM +0800, wliang@stu.xidian.edu.cn wrote:
>> 1160 /* Pop the stack */
>> 1161 parent = stack->parent;
>> 1162 pfree(stack);
>>
>> I think it may be a potential bug and can be fixed without any side-effect as:
>>
>>
>> ++ if (stack != &tail)
>> 1162 pfree(stack);
> I don't think it's necessary, it should be guaranteed that something as been
> pushed on the tail, ie. there shouldn't be a WJB_END_* before a corresponding
> begin.
I've not checked the logic, but the lack of any reported crashes here
seems to confirm that there's no bug.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rjuju123@gmail.com, wliang@stu.xidian.edu.cn, pgsql-bugs@lists.postgresql.org
Subject: Re: Report a potential bug caused by a improper call to pfree()
In-Reply-To: <216147.1643556567@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox