mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Fix use-after-free bug
Detected by buildfarm member prion
This commit is contained in:
@ -230,6 +230,12 @@ CreateStatistics(CreateStatsStmt *stmt)
|
|||||||
statoid = HeapTupleGetOid(htup);
|
statoid = HeapTupleGetOid(htup);
|
||||||
heap_freetuple(htup);
|
heap_freetuple(htup);
|
||||||
heap_close(statrel, RowExclusiveLock);
|
heap_close(statrel, RowExclusiveLock);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Invalidate relcache so that others see the new statistics.
|
||||||
|
*/
|
||||||
|
CacheInvalidateRelcache(rel);
|
||||||
|
|
||||||
relation_close(rel, NoLock);
|
relation_close(rel, NoLock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -250,11 +256,6 @@ CreateStatistics(CreateStatsStmt *stmt)
|
|||||||
|
|
||||||
ObjectAddressSet(address, StatisticExtRelationId, statoid);
|
ObjectAddressSet(address, StatisticExtRelationId, statoid);
|
||||||
|
|
||||||
/*
|
|
||||||
* Invalidate relcache so that others see the new statistics.
|
|
||||||
*/
|
|
||||||
CacheInvalidateRelcache(rel);
|
|
||||||
|
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user