mirror of
https://github.com/postgres/postgres.git
synced 2026-02-25 02:44:39 -05:00
Fix use-after-free bug
Detected by buildfarm member prion
This commit is contained in:
parent
3428ef7911
commit
8082bea2b0
1 changed files with 6 additions and 5 deletions
|
|
@ -230,6 +230,12 @@ CreateStatistics(CreateStatsStmt *stmt)
|
|||
statoid = HeapTupleGetOid(htup);
|
||||
heap_freetuple(htup);
|
||||
heap_close(statrel, RowExclusiveLock);
|
||||
|
||||
/*
|
||||
* Invalidate relcache so that others see the new statistics.
|
||||
*/
|
||||
CacheInvalidateRelcache(rel);
|
||||
|
||||
relation_close(rel, NoLock);
|
||||
|
||||
/*
|
||||
|
|
@ -250,11 +256,6 @@ CreateStatistics(CreateStatsStmt *stmt)
|
|||
|
||||
ObjectAddressSet(address, StatisticExtRelationId, statoid);
|
||||
|
||||
/*
|
||||
* Invalidate relcache so that others see the new statistics.
|
||||
*/
|
||||
CacheInvalidateRelcache(rel);
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue