Skip to content

Commit 922e15c

Browse files
committed
Fix use-after-free with multirange types in CREATE TYPE
The code was freeing the name of the multirange type function stored in the parse tree but it should not do that. Event triggers could for example look at such a corrupted parsed tree with a ddl_command_end event. Author: Alex Kozhemyakin, Sergey Shinderuk Reviewed-by: Peter Eisentraut, Michael Paquier Discussion: https://postgr.es/m/d5042d46-b9cd-6efb-219a-71ed0cf45bc8@postgrespro.ru Backpatch-through: 14
1 parent f4e1c88 commit 922e15c

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/backend/commands/typecmds.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,6 @@ DefineRange(CreateRangeStmt *stmt)
17221722
/* Create cast from the range type to its multirange type */
17231723
CastCreate(typoid, multirangeOid, castFuncOid, 'e', 'f', DEPENDENCY_INTERNAL);
17241724

1725-
pfree(multirangeTypeName);
17261725
pfree(multirangeArrayName);
17271726

17281727
return address;

0 commit comments

Comments
 (0)