Skip to content

Commit 8082bea

Browse files
committed
Fix use-after-free bug
Detected by buildfarm member prion
1 parent 3428ef7 commit 8082bea

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/backend/commands/statscmds.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ CreateStatistics(CreateStatsStmt *stmt)
230230
statoid = HeapTupleGetOid(htup);
231231
heap_freetuple(htup);
232232
heap_close(statrel, RowExclusiveLock);
233+
234+
/*
235+
* Invalidate relcache so that others see the new statistics.
236+
*/
237+
CacheInvalidateRelcache(rel);
238+
233239
relation_close(rel, NoLock);
234240

235241
/*
@@ -250,11 +256,6 @@ CreateStatistics(CreateStatsStmt *stmt)
250256

251257
ObjectAddressSet(address, StatisticExtRelationId, statoid);
252258

253-
/*
254-
* Invalidate relcache so that others see the new statistics.
255-
*/
256-
CacheInvalidateRelcache(rel);
257-
258259
return address;
259260
}
260261

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy