Skip to content

Conversation

@reshke
Copy link
Contributor

@reshke reshke commented Dec 22, 2025

stop_postmaster accepts single boolean arg, yet pointer of type ClusterInfo is passed. Remove this, and call stop_postmaster with false argument, resulting in smart (not fast) shutdown. Also remove redundant return at the end on void function.
Introduced as oversight in e20a488.

Fixed with help of coverity report:

** CID 640088:       Null pointer dereferences  (REVERSE_INULL)
/src/bin/pg_upgrade/pg_upgrade.c: 374           in get_cluster_version()


_____________________________________________________________________________________________
*** CID 640088:         Null pointer dereferences  (REVERSE_INULL)
/src/bin/pg_upgrade/pg_upgrade.c: 374             in get_cluster_version()
368     	cluster->dbid = dbid;
369     
370     	PQclear(res);
371     
372     	PQfinish(conn);
373     
>>>     CID 640088:         Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "cluster" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
374     	stop_postmaster(cluster);
375     
376     	return;
377     }
378     
379     #ifdef WIN32

 

stop_postmaster accepts single boolean arg, yet pointer of type
ClusterInfo is passed. Remove thar, and call stop_postmaster with
`false` argument, resulting in fast shutdown. Also remove redundant
return at the end on void function.
Introduced as oversight in e20a488.
Copy link
Contributor

@my-ship-it my-ship-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@reshke reshke merged commit f8210ef into apache:main Dec 23, 2025
61 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants