1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Fix uninitialized memory bug

Have interested callers of find_inheritance_children set the
detached_exist value to false prior to calling it, so that that routine
only has to set it true in the rare cases where it is necessary.  Don't
touch it otherwise.

Per buildfarm member thorntail (which reported a UBSan failure here).
This commit is contained in:
Alvaro Herrera
2021-04-22 16:04:48 -04:00
parent 84f15ccd4c
commit 43b55ec4bc
2 changed files with 2 additions and 4 deletions

View File

@@ -131,6 +131,7 @@ RelationBuildPartitionDesc(Relation rel, bool omit_detached)
* concurrently, whatever this function returns will be accurate as of
* some well-defined point in time.
*/
detached_exist = false;
inhoids = find_inheritance_children(RelationGetRelid(rel), omit_detached,
NoLock, &detached_exist);
nparts = list_length(inhoids);