projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3428ef7
)
Fix use-after-free bug
author
Alvaro Herrera
<
[email protected]
>
Fri, 24 Mar 2017 18:43:03 +0000
(15:43 -0300)
committer
Alvaro Herrera
<
[email protected]
>
Fri, 24 Mar 2017 18:43:15 +0000
(15:43 -0300)
Detected by buildfarm member prion
src/backend/commands/statscmds.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/commands/statscmds.c
b/src/backend/commands/statscmds.c
index 416309106a7f4bf73ab6dea56fd1d8907c66d78a..0750329961037ffa5c1f22024a3893d688e2cf98 100644
(file)
--- a/
src/backend/commands/statscmds.c
+++ b/
src/backend/commands/statscmds.c
@@
-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;
}