From: Tatsuo Ishii Date: Wed, 6 Apr 2022 05:50:56 +0000 (+0900) Subject: Fix possible null pointer dereference per Coverity. X-Git-Tag: V4_0_19~13 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=4923f16a228b65d43c3e3959aeb2f495fb0dd4a9;p=pgpool2.git Fix possible null pointer dereference per Coverity. --- diff --git a/src/protocol/child.c b/src/protocol/child.c index 79e70e651..6d7c6688b 100644 --- a/src/protocol/child.c +++ b/src/protocol/child.c @@ -503,8 +503,12 @@ backend_cleanup(POOL_CONNECTION * volatile *frontend, POOL_CONNECTION_POOL * vol * Close frontend connection */ reset_connection(); - pool_close(*frontend); - *frontend = NULL; + + if (*frontend != NULL) + { + pool_close(*frontend); + *frontend = NULL; + } if (cache_connection == false) {