Re: Bug in DefineRange() with multiranges

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Sergey Shinderuk <s.shinderuk@postgrespro.ru>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Cc: Alex Kozhemyakin <a.kozhemyakin@postgrespro.ru>
Date: 2021-10-10T17:12:30Z
Lists: pgsql-hackers
On 04.10.21 19:09, Sergey Shinderuk wrote:
> I wonder what is the proper fix.  Just drop pfree() altogether or add
> pstrdup() instead?  I see that makeMultirangeTypeName() doesn't bother
> freeing its buf.

I think removing the pfree()s is a correct fix.




Commits

  1. Fix use-after-free with multirange types in CREATE TYPE